def fat(n):
    c = 1
    for i in xrange(2,n+1):
        c *= i
    return c

t = int(raw_input())
for i in xrange(t):
    n = int(raw_input())
    print fat(n)

5a0b038b4f214981ca4571754c658304aa6906fb
def fat(n):
    c = 1
    for i in xrange(2,n+1):
        c *= i
    return c

t = int(raw_input())
for i in xrange(t):
    n = int(raw_input())
    print fat(n)
