import java.io.*;
import java.math.BigInteger;
public class small {
public static final int MAX_SIZE = 100;
public static BigInteger factorial( final int n ) {
BigInteger result = BigInteger.ONE;
if ( n == 0 ) {
return BigInteger.ONE;
} else {
result = new BigInteger( "" + n ).multiply( factorial( n - 1 ) );
return result;
}
}
public static void main( final String[] args ) throws IOException {
final BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );
final int m = Integer.parseInt( br.readLine() );
while ( m > 0 && m <= MAX_SIZE ) {
final int n = Integer.parseInt( br.readLine() );
if ( n <= MAX_SIZE ) {
System.out.println( factorial( n ) );
}
}
}
}