Var
  res       : array [1..35] of longint;
  cursimple : longint;
  num       : longint;
  cur       : byte;
Procedure FindNextSimple;
Var
  exitF     : boolean;
  i         : longint;
Begin
  repeat
    ExitF := false;
    if cursimple in [1..2] then inc(cursimple) else inc(cursimple,2);
    for i := 2 to round(sqrt(cursimple)) do if cursimple mod i = 0 then ExitF := true;
  until not ExitF;
End;{FindNextSimple}
{--------------------------------}
Begin
  Write('Введите число: ');
  ReadLn(num);
  cursimple := 1;
  cur := 1;
  While num <> 1 do
    begin
      FindNextSimple;
      while num mod cursimple = 0 do
        begin
          num := num div cursimple;
          res[cur] := cursimple;
          inc(cur);
        end;
    end;
  cur :=1;
  While res[cur] <> 0 do
    begin
      Write(res[cur],' ');
      inc(cur);
    end;
  ReadLn
End.
