N=int(eval(input()))

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

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

MOD=10**9+7

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

print((ans % MOD))

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

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

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