import java.util.Scanner;
import java.math.BigInteger;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int len = sc.nextInt();
while (len-- > 0) {
int num = sc.nextInt();
System.out.println(fun(num));
}
}
private static BigInteger fun(int n) {
BigInteger res = BigInteger.ONE;
for (int i = 1; i <= n; i++) {
res = res.multiply(BigInteger.valueOf(i));
}
return res;
}
} import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int m = scanner.nextInt();
for (int i = 0; i < m; i++) {
int n = scanner.nextInt();
BigInteger res = BigInteger.ONE;
for (int j = 1; j <= n; j++) {
res = res.multiply(new BigInteger(j+""));
}
System.out.println(res);
}
}
} import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in=new Scanner (System.in);
int m=in.nextInt();
int []num=new int[m];
for(int i=0;i<m;i++) {
num[i]=in.nextInt();
}
long ji=1;
for(int i=0;i<m;i++) {
for(int j=1;j<=num[i];j++) {
ji*=j;
}
System.out.println(ji);
ji=1;
}
}
}