n = int(eval(input()))



mod = int(1e9+7)



have_any = 1

not_have_0 = 1

not_have_9 = 1

not_have_09 = 1



for _ in range(n):

    have_any *= 10

    have_any %= mod



    not_have_0 *= 9

    not_have_0 %= mod



    not_have_09 *= 8

    not_have_09 %= mod



not_have_9 = not_have_0



ans = have_any - not_have_0 - not_have_9 + not_have_09

ans %= mod

print(ans)

n = int(eval(input()))



mod = 10**9 + 7



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

ans %= mod



print(ans)

n = int(eval(input()))
mod = int(1e9 + 7)
have_any = 1
not_have_0 = 1
not_have_9 = 1
not_have_09 = 1
for _ in range(n):
    have_any *= 10
    have_any %= mod
    not_have_0 *= 9
    not_have_0 %= mod
    not_have_09 *= 8
    not_have_09 %= mod
not_have_9 = not_have_0
ans = have_any - not_have_0 - not_have_9 + not_have_09
ans %= mod
print(ans)

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

-mod = int(1e9 + 7) -have_any = 1 -not_have_0 = 1 -not_have_9 = 1 -not_have_09 = 1 -for _ in range(n): -    have_any *= 10 -    have_any %= mod -    not_have_0 *= 9 -    not_have_0 %= mod -    not_have_09 *= 8 -    not_have_09 %= mod -not_have_9 = not_have_0 -ans = have_any - not_have_0 - not_have_9 + not_have_09 +mod = 10**9 + 7 +ans = 10**n - 9**n * 2 + 8**n