program SoUocLa3;
var
n, i, count: integer;
begin
write('Nhap gia tri cua n (10<=n<=10^9): ');
readln(n);
writeln('Cac so co so uoc la 3 tu 1 den ', n, ' la:');
count := 0;
for i := 1 to n do
begin
if (n mod i = 0) then
begin
count := count + 1;
end;
if (count = 3) then
begin
write(i, ' ');
count := 0;
end;
end;
readln;
end.