function factorial(n)
    if (n == 0) then
        return 1
    else
        return n * factorial(n - 1)
    end
end

no_of_test_cases = io.read()
answers = {}

for i=0,no_of_test_cases-1,1
do
    answers[i] = factorial(io.read())
end

for i=0,no_of_test_cases-1,1
do
    io.write(answers[i])
    io.write('\n')
end