program zxc;
var
l:char;
k,n,p:longint;
n1,n2:ansistring;
procedure suan(n1,n2:ansistring);
var
i,j,x,a1,b1,c1:longint;
a,b,c:array[0..15000]of longint;
begin
a1:=length(n1);
b1:=length(n2);
for i:=0 to a1 do a[a1-i+1]:=ord(n1[i])-ord('0');
for i:=0 to b1 do b[b1-i+1]:=ord(n2[i])-ord('0');
for i:=0 to a1 do
begin
x:=0;
for j:=0 to b1 do
begin
x:=a[i]*b[j]+x div 10+c[i+j-1];
c[i+j-1]:=x mod 10;
end;
c[i+j]:=c[i+j]+x div 10;
end;
c1:=i+j; while (c[c1]=0)and(c1>1) do dec(c1);
for i:=c1 downto 0 do n1:=n1+chr(c[i]+ord('0'));
end;
begin
read(l);
while l<>' ' do begin n1:=n1+l; read(l); end; readln(p);
n2:=n1;
for k:=1 to p do suan(n1,n2);
writeln(n1);
end.