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