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