#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e5+1e4,M=1e3+1e2;
const ll Maxn=0x3ffffff,Minm=-0x3ffffff;
ll t,n;
ll f[N];
void ans(ll x,ll k)
{
if(x>20)return ;
f[x]=k*x;
ans(x+1,f[x]);
}
signed main()
{
ans(1,1);
cin>>t;
while(t--)
{
cin>>n;
cout<<f[n]<<"\n";
}
}