n = int(eval(input()))



mod = 10**9 + 7

ans = (10**n - 9**n - 9**n + 8**n) % mod

print(ans)

n = int(eval(input()))



mod = 10**9 + 7

ans = pow(10, n, mod)

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

ans += pow(8, n, mod)

print((ans%mod))

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

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

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