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