Var a,b,c,d,x,y: longint; function NOD(a,b:integer):integer; begin while(a<>0) and (b<>0) do if a>=b then a:= a mod b else b:= b mod a; NOD:=a+b; end; function NOK(a,b:integer):integer; begin NOK:=a*b div NOD(a,b) end; Begin Read(a,b,c,d); x:=NOK(a,b); y:=NOK(c,d); Writeln(NOK(x,y)); end.
function NOD(a,b:integer):integer;
begin
while(a<>0) and (b<>0) do
if a>=b then a:= a mod b
else b:= b mod a;
NOD:=a+b;
end;
function NOK(a,b:integer):integer;
begin
NOK:=a*b div NOD(a,b)
end;
Begin
Read(a,b,c,d);
x:=NOK(a,b);
y:=NOK(c,d);
Writeln(NOK(x,y));
end.