N = int(eval(input()))

MOD = 10**9 + 7



n9 = 1

n8 = 1

n10 = 1



for i in range(N):

    n9 = (n9*9)%MOD

    n8 = (n8*8)%MOD

    n10 = (n10*10)%MOD



ans = n10 - 2*n9 + n8

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

MOD = 10**9 + 7

val1 = pow(9,N,MOD)



val2 = pow(8,N,MOD)

ans = pow(10,N,MOD) - 2*val1 + val2

print((ans%MOD))
N = int(eval(input()))
MOD = 10**9 + 7
n9 = 1
n8 = 1
n10 = 1
for i in range(N):
    n9 = (n9 * 9) % MOD
    n8 = (n8 * 8) % MOD
    n10 = (n10 * 10) % MOD
ans = n10 - 2 * n9 + n8
print((ans % MOD))

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

-n9 = 1 -n8 = 1 -n10 = 1 -for i in range(N): -    n9 = (n9 * 9) % MOD -    n8 = (n8 * 8) % MOD -    n10 = (n10 * 10) % MOD -ans = n10 - 2 * n9 + n8 +val1 = pow(9, N, MOD) +val2 = pow(8, N, MOD) +ans = pow(10, N, MOD) - 2 * val1 + val2