import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = int(read()) MOD = 10 ** 9 + 7 x = 4 * pow(10,N,MOD) - 1 x *= (MOD+1) // 3 print(x % MOD)