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