class Fact
	def fact(n)
		f=1 
		while(a>1) 
			f=f*a 
			a=a-1 
		end 
		return f
	end 
end
t=gets.to_i 
while(t>0) 
a=gets.to_i 
puts Fact.new.fact(a)
t=t-1 
puts f 
end 