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