s = int(eval(input()))

MOD = 10**9 + 7

C = [0]*(s + 1)

C[0] = 1

for n in range(3, s+1): # n:[3,s]

    for i in range(3, n+1): # i:[3,n]

        C[n] += C[n-i]

        C[n] %= MOD

print((C[s]))

s = int(eval(input()))

MOD = 10**9 + 7

C = [0]*(s + 1)

C[0] = 1

for n in range(3, s+1): # n:[3,s]

    C[n] = sum(C[:n-3+1]) % MOD # sum(C[0,n-3])

print((C[s]))

s = int(eval(input()))
MOD = 10**9 + 7
C = [0] * (s + 1)
C[0] = 1
for n in range(3, s + 1):  # n:[3,s]
    for i in range(3, n + 1):  # i:[3,n]
        C[n] += C[n - i]
        C[n] %= MOD
print((C[s]))

s = int(eval(input()))
MOD = 10**9 + 7
C = [0] * (s + 1)
C[0] = 1
for n in range(3, s + 1):  # n:[3,s]
    C[n] = sum(C[: n - 3 + 1]) % MOD  # sum(C[0,n-3])
print((C[s]))

-    for i in range(3, n + 1):  # i:[3,n] -        C[n] += C[n - i] -        C[n] %= MOD +    C[n] = sum(C[: n - 3 + 1]) % MOD  # sum(C[0,n-3])