fact(n):
	if n == 0:
		return 1
	return n*fact(n-1)

x = int(input())

for i in range(n):
	y = int(input())
	z = fact(y)
	print(z)
