N = int(input()) MOD = pow(10, 9)+7 M = (4 * pow(10, N, MOD) - 1) % MOD # print(M) if M % 3 == 0: print(M // 3) elif M % 3 == 1: print((M + MOD) // 3) else: print((M+2*MOD) // 3)