var s,i,m,n:longint;begin readln(n); for s:=2 to n do begin m:=0; for i:=1 to s div 2 do begin if s mod i=0 then m:=m+i; end; if m=s then writeln(s); end; writeln('over');end.