M = 1000000007 N = int(input()) A = pow(10,N,M)*4-1 B = pow(3,M-2,M) print(A*B%M)