n = int(eval(input()))

p = 1

MOD = 10**9+7

for i in range(n): p = p*(i+1)%MOD

print(p)
n = int(eval(input()))

mod = 10 ** 9 + 7

power = 1

for i in range(1,n+1):

    power = (power*i)%mod

print(power)
n = int(eval(input()))
p = 1
MOD = 10**9 + 7
for i in range(n):
    p = p * (i + 1) % MOD
print(p)

n = int(eval(input()))
mod = 10**9 + 7
power = 1
for i in range(1, n + 1):
    power = (power * i) % mod
print(power)

-p = 1 -MOD = 10**9 + 7 -for i in range(n): -    p = p * (i + 1) % MOD -print(p) +mod = 10**9 + 7 +power = 1 +for i in range(1, n + 1): +    power = (power * i) % mod +print(power)