const val mod = 1000000007L

fun main() {
    val n = readLine()!!.toInt()
    val dp = longArrayOf(8, 2, 0)
    for (i in 2..n) {
        dp[2] = (dp[2] * 10 + dp[1]) % mod
        dp[1] = (dp[1] * 9 + dp[0] * 2) % mod
        dp[0] = dp[0] * 8 % mod
    }
    println(dp[2])
}
