let readInt _ = stdin.ReadLine() |> int64

let modPown m x y =
    [ 1 .. y ] |> List.fold (fun a _ -> a * x % m) 1L

let mpown = modPown 1000000007L

()
|> readInt
|> fun x ->
    if x = 1L then
        0L
    else if x = 2L then
        2L
    else
        let a = mpown 10L (int x)
        let b = mpown 9L (int x)
        let c = mpown 8L (int x)
        (a - 2L * b + c) % x
|> printfn "%d"
