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