#include<stdio.h>
double FACT(short int n) ;
int main()
{
short int X,i=0;
int NUM[100];
scanf("%d",&X);
if(1<=X<=100){
while(i<X){
scanf("%d",&NUM[i]);
i++;
}
}
i=0;
while(i<X){
if(1<=(NUM[i])<=100){
printf("%.0lf\n",FACT(NUM[i]));
}
i++;
}
return 0;
}
double FACT(short int n){
short int i;
double sum=1;
for(i=1;i<=n;i++){
sum*=i;
}
return(sum);
}
I2luY2x1ZGU8c3RkaW8uaD4KZG91YmxlIEZBQ1Qoc2hvcnQgaW50IG4pIDsKaW50IG1haW4oKQp7CnNob3J0IGludCBYLGk9MDsKaW50IE5VTVsxMDBdOwpzY2FuZigiJWQiLCZYKTsKaWYoMTw9WDw9MTAwKXsKd2hpbGUoaTxYKXsKc2NhbmYoIiVkIiwmTlVNW2ldKTsKaSsrOwp9Cn0KaT0wOwp3aGlsZShpPFgpewogICAgICAgIGlmKDE8PShOVU1baV0pPD0xMDApewpwcmludGYoIiUuMGxmXG4iLEZBQ1QoTlVNW2ldKSk7Cn0KaSsrOwp9CnJldHVybiAwOwp9Cgpkb3VibGUgRkFDVChzaG9ydCBpbnQgbil7CnNob3J0IGludCBpOwpkb3VibGUgc3VtPTE7CmZvcihpPTE7aTw9bjtpKyspewpzdW0qPWk7Cn0KcmV0dXJuKHN1bSk7Cn0=