N=int(eval(input()))

mod=10**9+7

t=0

a,b,c=1,1,1

for i in range(N):

    a*=10

    b*=9

    c*=8

    if i%10==0:

        a%=mod

        b%=mod

        c%=mod

ans=(a+c-(2*b))%mod

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

mod = 10**9+7

ans = pow(10,N,mod)

ans -= pow(9,N,mod)*2

ans += pow(8,N,mod)

print((ans%mod))

N = int(eval(input()))
mod = 10**9 + 7
t = 0
a, b, c = 1, 1, 1
for i in range(N):
    a *= 10
    b *= 9
    c *= 8
    if i % 10 == 0:
        a %= mod
        b %= mod
        c %= mod
ans = (a + c - (2 * b)) % mod
print(ans)

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

-t = 0 -a, b, c = 1, 1, 1 -for i in range(N): -    a *= 10 -    b *= 9 -    c *= 8 -    if i % 10 == 0: -        a %= mod -        b %= mod -        c %= mod -ans = (a + c - (2 * b)) % mod -print(ans) +ans = pow(10, N, mod) +ans -= pow(9, N, mod) * 2 +ans += pow(8, N, mod) +print((ans % mod))