Program NhatNgu;
Uses crt;
Var a,b,i: longint;
Function ngto(a: longint): boolean;
Var i: longint;
Begin
If a<2 then exit(false);
For i:=2 to a div 2 do
If a mod i = 0 then exit(false);
exit(true);
End;
Function UCLN(x,y: longint): longint;
Var r: longint;
Begin
r:=y mod x;
While r<>0 do
Begin
r:=x mod y;
x:=y;
y:=r;
End;
UCLN:=x;
End;
Begin
Clrscr;
Write('Nhap a, b: '); Readln(a,b);
For i:=a to b do
If ngto(i) then Write(i,' ');
Writeln;
Write('UCLN(',a,',',b,') = ',UCLN(a,b));
Readln
End.