let (+@) a b = (a + b) mod 1000000007
let f = max_int
let trans =
  [(0, [1; 0; 2; 0]); (1, [1; 3; 4; 5]);
   (2, [6; 0; 2; 0]); (3, [1; 0; f; 0]);
   (4, [6; f; 7; 8]); (5, [1; 0; 9; 0]);
   (6, [1; f; 4; 5]); (7, [6; f; 2; 0]);
   (8, [1; f; 2; 0]); (9, [6; f; 2; 0]);]
let transr =
  Array.init 10 (fun i ->
    List.fold_left (fun stk (u, vs) -> 
      List.fold_left (fun stk v ->
        if v = i then u::stk else stk) stk vs) [] trans)
let () =
  Scanf.scanf "%d" @@ fun n ->
  let rec g i arr =
    if i >= n then Array.fold_left (+@) 0 arr else
    Array.map (fun vs ->
      List.fold_left (fun s i -> s +@ arr.(i)) 0 vs) transr
    |> g (i+1)
  in
  g 0 [|1;0;0;0;0;0;0;0;0;0;|] |> Printf.printf "%d\n"


