program tmp;
uses crt;
var m,i:longint;
function simple(n:longint):boolean;
var i:longint;
begin
simple:=true;
for i:=2 to round(sqrt(n)) do if n mod i=0 then
begin
simple:=false;
break;
end;
end;
begin
clrscr;
write('enter n: '); readln(n);
for i:=2 to n do if simple(i) then write(i,' ');
readkey;
end.