import java.util.*;
class RainBowa {
public static void main(String a[]) {
int n, t, fact;
Scanner sc = new Scanner(System.in);
t = sc.nextInt();
int ar[] = new int[t];
for (int i = 0; i < t; i++) {
ar[i] = sc.nextInt();
}
for (int i = 0; i < t; i++) {
fact = 1;
for (int j = ar[i]; j >= 1; j--) {
fact = fact * j;
}
System.out.println(fact);
}
}
}