def ex_euclid(x, y): c0, c1 = x, y a0, a1 = 1, 0 b0, b1 = 0, 1 while c1: a0, a1 = a1, a0 - c0 // c1 * a1 b0, b1 = b1, b0 - c0 // c1 * b1 c0, c1 = c1, c0 % c1 return c0, a0, b0 def modinv(x, mod): c, a, b = ex_euclid(x, mod) return a % mod MOD = 1000000007 N = int(input()) res = (pow(10, N, MOD) * 4 - 1) * modinv(3, MOD) % MOD print(res)