Program hotrotinhoc;
var a,b,i: word;
function nt(x: word) : boolean;
var j: integer;
begin
nt:=true;
if (x=2) or (x=3) then exit;
nt:=false;
if (x=1) or (x mod 2=0) or (x mod 3=0) then exit;
j:=6;
while j<=trunc(sqrt(x)) do
begin
if (x mod j=0) or (x mod (j+2)=0) then exit;
i:=i+5;
end;
nt:=true;
end;
begin
readln(a,b);
for i:=a to b do if nt(i) then writeln(i);
readln
end.
uses crt;
var a,b,kt,i,j:integer;
begin
clrscr;
write('nhap a='); readln(a);
write('nhap b='); readln(b);
if a<b then
begin
for i:=a to b do
begin
kt:=0;
for j:=2 to i-1 do
if i mod j=0 then kt:=1;
if kt=0 then writeln(i);
end;
end;
readln;
end.