uses crt;
var f,f1:text;
n,i:longint;
scan:boolean;
begin
clrscr;
assign(f,'UOCNT.INP'); reset(f);
assign(f1,'UOCNT.OUT'); rewrite(f1);
readln(f,n);
scan:=false;
if n<2 then scan:=false;
for i:=2 to trunc(sqrt(n)) do if n mod i=0 then scan:=false;
scan:=true;
if n=0 then write('Co vo so uoc nguyen to')
else
i:=2;
for i:=2 to n-1 do
begin
if n mod i=0 then write(f1,i,' ');
end;
close(f);
close(f1);
readln;
end.