import java.util.*;
import java.lang.*;
class Main
{ static String fib(int f)
{
if(f!=1)
return ""+(f*(Integer.parseInt(fib(f-1))));
else
return "1";
}
public static void main(String[] args) throws java.lang.Exception
{
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner sc= new Scanner(System.in);
int f= sc.nextInt();
int a[]=new int[f];
int i;
for( i=0;i<f;i++)
a[i]=sc.nextInt();
for( i=0;i<f;i++)
System.out.println(fib(a[i]));
}
}