uses crt;
var i,n,t,ans,k,cnt:longint;
function cntU(n:longint):longint;
var i,cnt,res:longint;
begin
res:=1;
i:=2;
while true do
begin
if i*i > n then break;
cnt:=0;
while n mod i = 0 do
begin
inc(cnt);
n:=n div i;
end;
res:=res*(cnt+1);
inc(i);
end;
if n <> 1 then res:=res*2;
exit(res);
end;
begin
clrscr;
repeat
write('Nhap so N: ');
readln(n);
until n > 0;
write('Cac uoc cua N la: ');
for i:=1 to n div 2 do
if n mod i = 0 then
begin
inc(cnt);
write(i,'; ');
end;
writeln(n);
writeln('So uoc cua N la: ',cnt+1);
ans:=1;t:=1;
for i:=2 to n-1 do
begin
k:=cntU(i);
if k > t then
begin
t:=k;
ans:=i;
end;
end;
writeln('So M la: ',ans);
readln;
end.