uses crt;
var a,b,i,t:longint;
function nt(a:longint):boolean;
var i:longint;
begin
i:=2;
while (a>1)and(a mod i<>0) do inc(i);
nt:=i=a;
end;
begin
clrscr;
write('a,b= ');readln(a,b);
write('Cac so nguyen to: ');
for i:=a to b do
if nt(i) then write(i,' ');
writeln;
for i:=1 to a do if (a mod i=0)and(b mod i=0) then t:=i;
writeln('UCLN(',a,',',b,')=',t);
readln
end.