Var A1:Word;A2:Byte;Function A6(A1:LongInt):LongInt;Var A3:LongInt;Pr:Boolean;A4,A5:LongInt;Begin If A1=1then Begin A6:=0;
Exit;end;Pr:=True;For A3:=2 to A1 div 2do If A1 mod A3=0then Begin A4:=A3;Pr:=False;Break;end;If Pr then Begin A6:=1;Exit;end;
A5:=A1 div A4;A6:=A6(A4)*A5+A4*A6(A5);end;Begin ReadLn(A1,A2);For A2:=A2 downto 1do A1:=A6(A1);WriteLn(A1);end.