n = int(input()) usi = 0 for i in range(n): usi += 3*pow(10,i) usi += pow(10,n) print(usi % 1000000007)