N = int(eval(input()))



print(((10 ** N - 2 * 9 ** N + 8 ** N) % (10 ** 9 + 7)))
N = int(eval(input()))



mod = 10 ** 9 + 7



print(((pow(10, N, mod) - 2 * pow(9, N, mod) + pow(8, N, mod)) % mod))
N = int(eval(input()))
print(((10**N - 2 * 9**N + 8**N) % (10**9 + 7)))

N = int(eval(input()))
mod = 10**9 + 7
print(((pow(10, N, mod) - 2 * pow(9, N, mod) + pow(8, N, mod)) % mod))

-print(((10**N - 2 * 9**N + 8**N) % (10**9 + 7))) +mod = 10**9 + 7 +print(((pow(10, N, mod) - 2 * pow(9, N, mod) + pow(8, N, mod)) % mod))