N = int(input()) Es = '1' for i in range(N): Es += '3' E = int(Es) A = E % 1000000007 print(A)