S = int(eval(input()))

M = 10 ** 9 + 7

def mod_pow(a, b, mod):

	bin_b = []

	while b:

		bin_b.append(b % 2)

		b >>= 1

	ret = 1

	for j in reversed(bin_b):

		ret = (ret * ret) % mod

		if j == 1:

			ret = (ret * a) % mod

	return ret

def mod_comb(n, k, mod):

	ret = 1

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

		ret = (ret * (n+1-i)) % mod

		ret = (ret * mod_pow(i, mod-2, mod)) % mod

	return ret

ans = 0

for K in range(1, S // 3 + 1):

  ans = (ans + mod_comb(S - 2 * K - 1, K - 1, M)) % M

print(ans)
S = int(eval(input()))

M = 10 ** 9 + 7

def mod_comb(n, k, mod):

	ret = 1

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

		ret = (ret * (n+1-i)) % mod

		ret = (ret * pow(i, mod-2, mod)) % mod

	return ret

ans = 0

for K in range(1, S // 3 + 1):

  ans = (ans + mod_comb(S - 2 * K - 1, K - 1, M)) % M

print(ans)

S = int(eval(input()))
M = 10**9 + 7


def mod_pow(a, b, mod):
    bin_b = []
    while b:
        bin_b.append(b % 2)
        b >>= 1
    ret = 1
    for j in reversed(bin_b):
        ret = (ret * ret) % mod
        if j == 1:
            ret = (ret * a) % mod
    return ret


def mod_comb(n, k, mod):
    ret = 1
    for i in range(1, k + 1):
        ret = (ret * (n + 1 - i)) % mod
        ret = (ret * mod_pow(i, mod - 2, mod)) % mod
    return ret


ans = 0
for K in range(1, S // 3 + 1):
    ans = (ans + mod_comb(S - 2 * K - 1, K - 1, M)) % M
print(ans)

S = int(eval(input()))
M = 10**9 + 7


def mod_comb(n, k, mod):
    ret = 1
    for i in range(1, k + 1):
        ret = (ret * (n + 1 - i)) % mod
        ret = (ret * pow(i, mod - 2, mod)) % mod
    return ret


ans = 0
for K in range(1, S // 3 + 1):
    ans = (ans + mod_comb(S - 2 * K - 1, K - 1, M)) % M
print(ans)

- - -def mod_pow(a, b, mod): -    bin_b = [] -    while b: -        bin_b.append(b % 2) -        b >>= 1 -    ret = 1 -    for j in reversed(bin_b): -        ret = (ret * ret) % mod -        if j == 1: -            ret = (ret * a) % mod -    return ret -        ret = (ret * mod_pow(i, mod - 2, mod)) % mod +        ret = (ret * pow(i, mod - 2, mod)) % mod