program salads;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const mn=100;
type chislo=array[1..mn] of longint;
var i,j,k,l,m,n:Longint;
    c:array[0..40,0..40] of chislo;
    ans,ans2:chislo;
procedure sum(n1,n2:chislo;var n3:chislo);
var i1,carry:longint;
begin
   fillchar(n3,sizeof(n3),0);
   carry:=0;
   for i1:=1 to mn do
   begin
      carry:=carry+n1[i1]+n2[i1];
      n3[i1]:=carry mod 10;
      carry:=carry div 10;
   end;
end;
procedure vivod(n1:chislo);
var i1,l1:longint;
begin
   l1:=-1;
   for i1:=mn downto 1 do
   if n1[i1]<>0 then
   begin
      l1:=i1;
      break;
   end;

   if l1=-1 then l1:=1;

   for i1:=l1 downto 1 do write(n1[i1]);

end;

//function

begin
   reset(input,'salads.in');
   fillchar(c,sizeof(c),0);
   c[0,0,1]:=1;
   c[1,0,1]:=1;
   c[1,1,1]:=1;
   for k:=2 to 40 do c[k,0,1]:=1;
   
   for n:=2 to 40 do
      for k:=1 to 40 do
         if n>=k then sum(c[n-1,k],c[n-1,k-1],c[n,k]);

//         vivod(c[5,2]);

   read(n);

   for m:=1 to n do
   begin
      read(k);
      fillchar(ans,sizeof(ans),0);
      fillchar(ans2,sizeof(ans2),0);
      for i:=2 to k do
      begin
        sum(ans,c[k,i],ans2);
        ans:=ans2;
      end;
      vivod(ans);
      writeln;
   end;

end.
