N = int(eval(input()))

ans = 10**N - 2*9**N + 8**N

print((ans%(10**9+7)))
N = int(eval(input()))

MOD = 10**9+7

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

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

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

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