uses crt;
var i,n:longint;
function NT(a:longint):boolean;
var dem,j:longint;
begin
dem:=0;
for j:=1 to a do if(a mod j=0)then inc(dem);
NT:=dem=2;
end;
begin
clrscr;
write('nhap n:');readln(n);
for i:=1 to n do if(NT(i))then write(i,' ');
readln
end.