program pil_11_54(input,output);
var
  a,b,c,d, t1, t2, result : integer;

function NOD(x,y : integer) : integer;
begin
  while (x<>0)and(y<>0) do
    if x>=y then x := x mod y
    else y := y mod x;
  NOD := x+y;
end;

begin
  Write('Input numbers : ');
  Read(a,b,c,d);
  t1 := a*b div NOD(a,b);
  t2 := c*d div NOD(c,d);
  result := t1*t2 div NOD(t1,t2);
  WriteLn('The result is ', result);
end.
