import math
if __name__ == '__main__':
tc = int(input())
for i in range(tc):
k = int(input())
print(math.factorial(k))
#include< iostream >
using namespace std;
long long int fact(int n)
{
if(n <= 1) return 1;
return n * fact(n-1);
}
int main() {
int n, t;
cin >> n;
while(n--) {
cin >> t;
cout << fact(t) << endl;
}
return 0;
}