const
o=2000000000;
type
ha=array[0..15001] of longint;
var
a,ans:ha;
n,p,i,c:longint;
ss:string;
f:boolean;
function max(a,b:int64):int64;
begin
if a>b then exit(a) else exit(b);
end;
procedure xx(var v,b:ha);
var
c:ha;
i,j:longint;
begin
fillchar(c,sizeof(c),0);
for i:=1 to v[0] do
for j:=1 to b[0] do c[i+j-1]:=c[i+j-1]+v[i]*b[j];
c[0]:=a[0]+b[0]-1;
for i:=1 to c[0] do
if c[i]>10 then
begin
inc(c[i+1],c[i] div 10);
c[i]:=c[i] mod 10
end;
if c[c[0]+1]<>0 then inc(c[0]);
v:=c;
end;
begin
assign(input,'cruel1.in');reset(input);
assign(output,'cruel1.out');rewrite(output);
readln(n,p);
str(n,ss);
a[0]:=length(ss);
for i:=1 to a[0] do val(ss[a[0]-i+1],a[i]);
ans[0]:=1;
ans[1]:=1;
while p<>0 do
begin
if p mod 2=1 then xx(ans,a);
p:=p shr 1;
xx(a,a);
end;
c:=0;
f:=false;
for i:=ans[0] downto 1 do
begin
if ans[i]<>0 then begin f:=true;end;
if f then
begin
write(ans[i]);
inc(c);
if c mod 70=0 then writeln
end;
end;
close(input);close(output);
end.