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