Scanf.scanf "%d" (fun n ->
    let z = 1_000_000_007 in
    let ( +@) a b = (a + b) mod z in
    let ( *@) a b = (a * b) mod z in

    let rec loop i d09 d0 d9 dn =
        if i = n then d09 else
            loop (i + 1) (d09 *@ 10 +@ d0 +@ d9) (d0 *@ 9 +@ dn) (d9 *@ 9 +@ dn) (dn *@ 8)
    in
    loop 0 0 0 0 1 |> Printf.printf "%d\n"
)