var
  n, f : integer; { n is the number to be factored, f is a prime factor }

procedure find_factor_f_in_n;
  begin
    f := 2; { the first prime factor to try, no need to try 1! }
    while ((n mod f) <> 0) and (n > f) do 
        { n mod f <> 0 means n is not divisible by f }
        { we want to exit when n <= f because when n = f, f is a factor! }
      f := f + 1; { try the next possible factor }
    if n < f then { to take care of the case when n = 1 }
      f := n
  end;

{*****************************************************}
{* MAIN PROGRAM                                      *}
{*****************************************************}

begin
  readln(n); { to read the number to factor }
  repeat
    find_factor_f_in_n;
    n := n div f;
    writeln(f)
  until n = 1
end.

