mod = 10 ** 9 + 7 N = int(input()) ten = pow(10, N, mod) three = (ten - 1) * pow(3, mod-2, mod) % mod print((ten + three) % mod)