import java.util.Scanner;
class Demo
{
public static int A(int no)
{
int count=1;
for(int m=1;m<=no;m++)
{
count = count*m;
}
return count;
}
public static void main(String args[])
{
Scanner s = new Scanner(System.in);
int n=s.nextInt();
for(int i=0;i<n;i++)
{
int num = s.nextInt();
System.out.println(A(num));
}
}
}