fun main() {
    val n = readInt()
    val mod = 1000000007L

    val factorials = LongArray(n + 1)
    factorials[0] = 1
    for (i in 1..n) {
        factorials[i] = (factorials[i - 1] * i) % mod
    }

    fun modPow(x: Long, n: Int, m: Long): Long {
        if (n == 0) return 1 % m
        var u = modPow(x, n / 2, m)
        u = (u * u) % m
        if (n % 2 == 1) u = (u * x) % m
        return u
    }

    fun modInverse(x: Long, m: Long): Long {
        return modPow(x, m.toInt() - 2, m)
    }

    fun aChooseB(a: Int, b: Int): Long {
        if (b > a) return 0L
        val numerator = factorials[a]
        val denominator = (factorials[b] * factorials[a - b]) % mod
        return (numerator * modInverse(denominator, mod)) % mod
    }

    val nChoose = LongArray(n + 1)
    for (i in 0..n) nChoose[i] = aChooseB(n, i)

    var ans = 0L
    for (x in 2..n) {
        val choose = nChoose[x]
        val twoPow = (modPow(2L, x, mod) + mod - 2) % mod
        val eightPow = modPow(8L, n - x, mod)
//        println("$choose $twoPow $eightPow")
        ans = (ans + (((choose * twoPow) % mod) * eightPow) % mod) % mod
    }

    println(ans)
}

// Input Reader
private fun readLn() = readLine()!!

private fun readInt() = readLn().toInt()
