N=int(eval(input()))

mod = 10**9+7

A=10**N%mod-2*9**N%mod+8**N%mod

print((A%mod))
N=int(eval(input()))

mod = 10**9+7

A=pow(10,N,mod)-2*pow(9,N,mod)+pow(8,N,mod)

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

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

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