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 = 10**9 + 7



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

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 = 10**9 + 7
ans = pow(10, n, mod) - pow(9, n, mod) * 2 + pow(8, n, mod)
ans %= mod
print(ans)

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