MOD = 10**9+7 N = int(input()) X = pow(10, N, MOD) ans = X + (X - 1) * pow(3, -1, MOD) ans %= MOD print(ans)