let (+@) a b = (a + b) mod 1000000007
let f = max_int
let () =
  Scanf.scanf "%d" @@ fun n ->
  let rec g i arr =
    if i >= n then Array.fold_left (+@) 0 arr else
    let arr' = Array.make 10 0 in
    [(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]);]
    |> List.iter (fun (s, ts) ->
        List.iter (fun t ->
          if t < f then arr'.(t) <- arr'.(t) +@ arr.(s)) ts);
    g (i+1) arr'
  in
  g 0 [|1;0;0;0;0;0;0;0;0;0;|] |> Printf.printf "%d\n"


