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