N = int(eval(input()))

MOD_BY = 10**9 + 7



#全通り 10**(N)

#0を1個も含まない　9**(N)

#9を1個も含まない　9**(N)

#0も9を1個も含まない　8**(N)



#https://wakabame.hatenablog.com/entry/2017/09/21/012844

#a**n mod pの高速計算

def power_func(a,n,p):

    bi = str(format(n,"b"))#2進表現に

    res = 1

    for i in range(len(bi)):

        res = (res*res) %p

        if bi[i] == "1":

            res = (res*a) %p

    return res

  

a = power_func(10,N,MOD_BY)

b = power_func(9,N,MOD_BY)

c = power_func(8,N,MOD_BY)

ans = a - 2*b + c

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

MOD_BY = 10**9 + 7

  

a = pow(10,N,MOD_BY)

b = pow(9,N,MOD_BY)

c = pow(8,N,MOD_BY)

ans = a - 2*b + c

print((ans%MOD_BY))
N = int(eval(input()))
MOD_BY = 10**9 + 7
# 全通り 10**(N)
# 0を1個も含まない　9**(N)
# 9を1個も含まない　9**(N)
# 0も9を1個も含まない　8**(N)
# https://wakabame.hatenablog.com/entry/2017/09/21/012844
# a**n mod pの高速計算
def power_func(a, n, p):
    bi = str(format(n, "b"))  # 2進表現に
    res = 1
    for i in range(len(bi)):
        res = (res * res) % p
        if bi[i] == "1":
            res = (res * a) % p
    return res


a = power_func(10, N, MOD_BY)
b = power_func(9, N, MOD_BY)
c = power_func(8, N, MOD_BY)
ans = a - 2 * b + c
print((ans % MOD_BY))

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

-# 全通り 10**(N) -# 0を1個も含まない　9**(N) -# 9を1個も含まない　9**(N) -# 0も9を1個も含まない　8**(N) -# https://wakabame.hatenablog.com/entry/2017/09/21/012844 -# a**n mod pの高速計算 -def power_func(a, n, p): -    bi = str(format(n, "b"))  # 2進表現に -    res = 1 -    for i in range(len(bi)): -        res = (res * res) % p -        if bi[i] == "1": -            res = (res * a) % p -    return res - - -a = power_func(10, N, MOD_BY) -b = power_func(9, N, MOD_BY) -c = power_func(8, N, MOD_BY) +a = pow(10, N, MOD_BY) +b = pow(9, N, MOD_BY) +c = pow(8, N, MOD_BY)