var s1,s2:string;
    kk,i,x,j,k,n:longint;
    f:text; c:string[1];



 function atr (var s1:string; var s2:string):string;
 var i:byte; s:string;
 begin

  s:='';

  for i:=1 to length(s2)-length(s1) do
      s:=s+'0';

  s:=s+s1;

  atr:=s;
 end;



 function calcul (s1,s2:string):string;
 var suma,x1,x2,i,c:byte; e:integer; s:string; x:string[2];
 begin

  s:=''; c:=0;

  for i:=length(s1) downto 1 do
      begin
       suma:=0;
       val(s1[i],x1,e);
       val(s2[i],x2,e);
       suma:=x1+x2+c;
       c:=0;
       if i=1 then begin str(suma,x); s:=x+s; end
       else if suma>9 then begin c:=1; str(suma mod 10,x); s:=x+s; end
       else begin str(suma,x); s:=x+s; end;
      end;

  calcul:=s;
 end;



 function ss (k:longint):string;
 var i:longint; r:string;
 begin

  r:='2';

  for i:=1 to k-1 do
      r:=calcul(r,r);

  ss:=r;
 end;



begin

 assign(f,'nr.in'); rewrite(f);

 readln(n,k);

 for i:=1 to n do
     begin
      read(x);
      kk:=k;
      for j:=1 to x do
          begin
           if j=1 then write(f,' ',ss(k),' ')
                  else write(f,ss(kk),' ');
           kk:=kk+k+1;
          end;
      writeln(f);
     end;

 close(f); reset(f);

 while not(seekeof(f)) do
       begin

        s1:=''; c:='';

        while c<>' ' do
              begin
               read(f,c);
               s1:=s1+c;
              end;

        while not(seekeoln(f)) do
              begin

               read(f,c); s2:=c;

               while c<>' ' do
                     begin
                      read(f,c);
                      s2:=s2+c;
                     end;

               if length(s1)>length(s2) then s2:=atr(s2,s1)
                          else s1:=atr(s1,s2);

               s1:=calcul(s1,s2);

              end;

        delete(s1,length(s1),1);

        writeln(s1);

        readln(f);

       end;

 close(f);

end.