import java.util.Scanner ;
class factorial
{
public static void main(String [] args)
{
Scanner inp = new Scanner(System.in);
int T= inp.nextInt();
int n;
int fact=1;
int i=0;
int j=1;
while(i<T)
{
n=inp.nextInt();
fact=1;
for(j=1;j<=n;j++)
{
fact=fact*j;
}
System.out.println(fact);
i++;
}
}
}