import java.util.TreeMap;
import java.util.Scanner;

public class ijoe
{

	int N;
	//Map of hex spots
	//first integer is i
	//second integer is j
	TreeMap<Integer,TreeMap<Integer,Spot> > M;

	public static void main(String Args[])
	{
		new ijoe();
	}

	public ijoe()
	{
		Scanner S=new Scanner(System.in);

		int C; C=S.nextInt();
		for(int c=0; c<C; c++)
		{

			N=S.nextInt();
			M=new TreeMap<Integer,TreeMap<Integer,Spot> >();

			//Initialize big ass space
			//with empty spots
			for(int i=-N*4; i<=N*4; i++)
			{
				M.put(i,new TreeMap<Integer,Spot>());
				for(int j=-N*4; j<=N*4; j++)
				{
					M.get(i).put(j,new Spot());
				}
			}

			//Initial setup, we have one(1) way to reach
			//origin (0,0) with N moves left.
			addHits(0,0,N,1);

			//For each number of moves left, decressing
			for(int t=N; t>=1; t--)
			{
				//Not sure what real bounds for i and j should be.
				//going large because I dont feel like thinking about it
				for(int i=-N*2; i<=N*2; i++)
				for(int j=-N; j<=N; j++)
				{
					//If we can get to i,j with t moves left
					//we must expand it
					if (M.get(i).get(j).Hits.get(t)>0)
					{
						expand(i,j,t);
					}
				}
			}

			//Number of ways we can get back to (0,0) with 0 moves left
			//is our answer
			System.out.println(M.get(0).get(0).Hits.get(0));

		}

	}


	class Spot
	{
		//Maps number of moves left to number of ways
		//to get here with that many moves left
		TreeMap<Integer,Integer> Hits;

		public Spot()
		{
			//Init Hits to be zero for all numbers of moves left
			//later code assumes that all the values exist in the map already
			Hits=new TreeMap<Integer,Integer>();
			for(int n=0; n<=N; n++)
			{
				Hits.put(n,0);
			}

		}

	}



	//Expand location i,j with number of movies left
	//v.  Each expansion has v-1 moves left
	private void expand(int i, int j, int v)
	{

		//Number of ways to get to this location
		//with this many moves left
		int hits=M.get(i).get(j).Hits.get(v);

		//At each new location we have v-1 moves left
		//and 'hits' more ways to get there
		addHits(i,j+2,v-1,hits);
		addHits(i,j-2,v-1,hits);
		addHits(i+1,j+1,v-1,hits);
		addHits(i+1,j-1,v-1,hits);
		addHits(i-1,j+1,v-1,hits);
		addHits(i-1,j-1,v-1,hits);

		//Note: the coordinates selected here make the math work out
		//The vertical hexes are +2 or -2 on the y
		//The others are +/- 1 on both x and y
		//so that you can go up left (-1,+1) and then up right (+1,+1) and end up at the
		//hex above the start (+0,+2)

	}

	//At hex (i,j) with moves left v, add the number 'add'
	private void addHits(int i, int j,int v, int add)
	{

		int val=M.get(i).get(j).Hits.get(v);
		val+=add;
		M.get(i).get(j).Hits.put(v,val);

	}

}
