var
N,i,k,x:integer;
begin
readln(N);
for i:=2 to N do
x:=0;
for k:=2 to trunc(sqrt(i)) do
if i mod k=0 then
x:=1;
if x=0 then
write(i,' ');
end;
end.
var
N,i,k,x:integer;
begin
readln(N);
for i:=2 to N do
begin
x:=0;
for k:=2 to trunc(sqrt(i)) do
if i mod k=0 then
x:=1;
if x=0 then
write(i,' ');
end;
end.