N = 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

ans = (mod_pow(10, N, M) - 2 * mod_pow(9, N, M) + mod_pow(8, N, M)) % M

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

M = 10 ** 9 + 7

ans = (pow(10, N, M) - 2 * pow(9, N, M) + pow(8, N, M)) % M

print(ans)
N = 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


ans = (mod_pow(10, N, M) - 2 * mod_pow(9, N, M) + mod_pow(8, N, M)) % M
print(ans)

N = int(eval(input()))
M = 10**9 + 7
ans = (pow(10, N, M) - 2 * pow(9, N, M) + pow(8, N, 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 - - -ans = (mod_pow(10, N, M) - 2 * mod_pow(9, N, M) + mod_pow(8, N, M)) % M +ans = (pow(10, N, M) - 2 * pow(9, N, M) + pow(8, N, M)) % M