program cojs934;
const
maxn=15000;
type
atype=array[0..maxn] of longint;
var
a,b:atype;
i,j,p,n:longint;
procedure gaocheng(var a:atype;b:atype);
var
i,j,k:longint;
c:atype;
begin
fillchar(c,sizeof(c),0);
for i:=1 to a[0] do
for j:=1 to b[0] do
begin
c[i+j-1]:=c[i+j-1]+a[i]*b[j];
if c[i+j-1]>=10 then
begin
c[i+j]:=c[i+j]+c[i+j-1] div 10;
c[i+j-1]:=c[i+j-1] mod 10;
end;
end;
c[0]:=a[0]+b[0]-1;
if c[c[0]+1]<>0 then
inc(c[0]);
while c[c[0]]>10 do
begin
inc(c[0]);
c[c[0]]:=c[c[0]]+c[c[0]-1] div 10;
c[c[0]-1]:=c[c[0]-1] div 10;
end;
for i:=0 to c[0] do
a[i]:=c[i];
end;
begin
assign(input,'cruel1.in');
assign(output,'cruel1.out');
reset(input);
rewrite(output);
readln(n,p);
while n>0 do
begin
inc(a[0]);
a[a[0]]:=n mod 10;
n:=n div 10;
end;
b[0]:=1; b[1]:=1;
while p>0 do
begin
if p mod 2=1 then gaocheng(b,a);
p:=p div 2;
gaocheng(a,a);
end;
j:=0;
for i:=b[0] downto 1 do
begin
inc(j);
write(b[i]);
if j mod 70 =0 then
begin
j:=0;
writeln;
end;
end;
close(input);
close(output);
end.