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

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

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