#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
const int N = 25;
int t,n,m,k,l,r,op,x,y;
ll f[N];
bool flag;
void solve(){
f[1] = 1;
for(int i = 2;i<N;i++){
f[i] = i * f[i-1];
}
cin>>t;
while(t--){
cin>>n;
cout<<f[n]<<"\n";
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
solve();
return 0;
}