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