Var a,b,ta,tb,r,ucln,bcnn:integer;
Begin
Write('a = ');readln(a);
Write('b = ');readln(b);
ta:=a;
tb:=b;
Repeat
r:=ta mod tb;
ta:=tb;
tb:=r;
Until r = 0;
ucln:=ta;
bcnn:=a*b div ucln;
Writeln('UCLN(',a,' ',b,') la ',ucln);
Write('BCNN(',a,' ',b,' la ',bcnn);
Readln
End.