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