N = int(input()) d = 1000000007 n = (10**N)%d for i in range(N): n += (3*(10**(N-1-i)))%d n %= d print(n)