// Michael Galletti
// 3/12/2014
// Solution to FHSPS Problem: Seating Arrangement(seating)

import java.util.*;
import java.io.*;

public class seating_galletti {
	static int N; //Number of couples
	public static void main(String[] args) throws Exception{
		Scanner reader = new Scanner(new File("seating.in"));
		
		int times = reader.nextInt();
		for(int t = 0; t < times; t++){
			int n = N = reader.nextInt();
			
			int[] left = new int[n]; //Number of people left in each couple, to be used in our recurrence
			Arrays.fill(left,2); //Initially 2 people in each couple
			
			System.out.println(f(0,-1,left));
		}
	}
	
	//This function will count the number of valid couple arrangements
	public static int f(int at, int last, int[] left){
		if(at == 2*N)
			return 1; //We've found a valid arrangement of the couples!
		
		int sum = 0; //Accumulator for valid arrangements
		boolean first = false; //We can only place one "new" couple in this spot, so keep track of whether we've done that.
		
		//We'll iterate through the couples and try to place members here where able.
		for(int i = 0; i < left.length; i++){ 
			left[i]--; //Pretend we're placing a person from this couple here (doesn't matter if this goes negative, we account for it)
			
			//We'll only place a single "new" couple in this slot, so keep track of whether we've done it or not
			//We do this with the "first" boolean
			if(!first && left[i]+1 == 2){ //A "new" couple will have 2 people left to place
				//Place a person from this couple and recurse. 
				//We'll set "last" to "i" so we know not to place the other member of this couple next.
				sum += f(at+1, i, left);
				
				//Set "first" to true, we won't place another "new" couple in this slot (and therefore won't overcount!)
				first = true;
			}else if(i != last && left[i]+1 == 1){ //Otherwise, we can place any lone member here, provided they don't match the last person placed.
				//Place the last person from this couple and recurse.
				sum += f(at+1, i, left);
			}
			
			left[i]++; //Undo the placement
		}
		
		return sum; //Return our answer!
	}
}
