uses crt;
var n,i,t:int64;
begin
clrscr;
repeat
write('Nhap n='); readln(n);
until (0<n) and (n<1000000000);
t:=0;
for i:=1 to n-1 do
if n mod i=0 then t:=t+i;
if t=n then writeln(n,' la so hoan hao')
else writeln(n,' khong la so hoan hao');
readln;
end.