program a3;
var
N,P,i,j,x,y,k:longint;
a,b,c:array[1..16000]of integer;
begin
assign(input,'cruell.in');
reset(input);
assign(output,'cruell.out');
rewrite(output);
readln(N,P);
while N<>0 do begin
inc(i);a[i]:=N mod 10;
N:=N div 10;
end;
x:=i;y:=1;b[1]:=1;
while P<>0 do begin
if P mod 2=1 then begin
for i:=1 to x do begin
for j:=1 to y do begin
c[i+j-1]:=c[i+j-1]+(a[i]*b[j])+k;
if c[i+j-1]>=10 then begin
k:=c[i+j-1]div 10;c[i+j-1]:=c[i+j-1]mod 10;end else
k:=0; end;
if k<>0 then begin c[i+j]:=k+c[i+j];k:=0;end;
end;
y:=x+y-1;if c[i+j]<>0 then inc(y);
for i:=1 to y do begin
b[i]:=c[i];c[i]:=0;end;
end;
P:=P div 2;
k:=0;
for i:=1 to x do begin
for j:=1 to x do begin
c[i+j-1]:=c[i+j-1]+(a[i]*a[j])+k;
if c[i+j-1]>=10 then begin
k:=c[i+j-1]div 10;c[i+j-1]:=c[i+j-1]mod 10;end else
k:=0;
end;
if k<>0 then begin c[i+j]:=c[i+j]+k;k:=0;end;
end;
x:=i+j-1;if c[i+j]<>0 then inc(x);
for i:=1 to x do begin
a[i]:=c[i];c[i]:=0;end;
end;
for i:=y downto 1 do begin
if (i<>y)and((y-i+1) mod 70=0)then writeln;
write(b[i]);end;
close(input);
close(output);
end.