type numbertype=array[1..10010]of integer;var strl1:string;a,b:numbertype;strl2:integer;len1,len2,i,k:integer;ch:char;procedure turn1(strl:string);var i,j,k:longint;beginfillchar(a,sizeof(a),0);for i:=1 to len1 do a[len1-i+1]:=ord(strl [i] )-48;k:=10;while a [k] =0 do dec(k);end;procedure turn2(strl:string);var i,j,k:longint;beginfillchar(b,sizeof(a),0);for i:=1 to len1 do b[len1-i+1]:=ord(strl [i] )-48;k:=10;while b [k] =0 do dec(k);end;procedure chengx(b:numbertype;var a:numbertype);var i,j:longint;beginfor i:=len1 downto 1 dobeginfor j:=len1 downto 2 do inc(a[i+j-1],a [i] *b [j] );a [i] :=a [i] *b [1] ;end;k:=k+len1+len2-1;for i:=1 to k dobegininc(a[i+1],a [i] div 10);a [i] :=a [i] mod 10;end;if a[k+1]<>0 then inc(k,1);j:=500;while a [j] =0 do dec(j);len1:=j;end;
beginwhile not eoln dobeginread(ch);if ch=' ' then break else strl1:=strl1+ch;end;read(strl2);if strl2=0 then begin writeln('1') ;halt;end;if strl2=1 then begin writeln(strl1);halt;end;len1:=length(strl1);turn1(strl1);turn2(strl1);for i:=2 to strl2 dochengx(b,a);k:=10010;while a [k] =0 do dec(k);for i:=k downto 1 do write(a [i] );end.
beginwhile not eoln dobeginread(ch);if ch=' ' then break else strl1:=strl1+ch;end;read(strl2);if strl2=0 then begin writeln('1') ;halt;end;if strl2=1 then begin writeln(strl1);halt;end;len1:=length(strl1);turn1(strl1);turn2(strl1);for i:=2 to strl2 dochengx(b,a);k:=10010;while a [k] =0 do dec(k);for i:=k downto 1 do write(a [i] );end.