program Hello;
var i, a, b, aux, aux2 :integer;
begin
write('Dati numerele:'); readln(a,b);
aux:=a;
aux2:=b;
while(aux2<>0) do begin
i:=aux mod aux2;
aux:=aux2;
aux2:=i;
end;
Writeln('Cmmdc=', aux);
aux:=a mod b;
aux2:=a*b;
while(aux<>0) do begin
a:=b;
b:=aux;
aux:=a mod b;
end;
Writeln('Cmmmc=', aux2/b:2:2);
end.