program Project2; {$APPTYPE CONSOLE} uses SysUtils; var i,j,n,s:integer; f1,f2:text; begin assign(f1,'input.txt'); reset(f1); readln(f1,n); close(f1); assign(f2,'output.txt'); rewrite(f2); for i:=1 to n do begin s:=0; for j:=1 to i-1 do if i mod j=0 then s:=s+j; if i=s then writeln(f2,i); end; close(f2); end.