prime = 10 ** 9 + 7

n = int(eval(input()))

ans = 10 ** n - (9 ** n) * 2 + 8 ** n

ans %= prime

print(ans)
mod = 10 ** 9 + 7

n = int(input())

ans = pow(10, n, mod) - pow(9, n, mod ) * 2\

     + pow(8, n, mod)

ans %= mod

print(ans)

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

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

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