Scanf.scanf "%d %d %d" (fun h w k ->
    let rec loop i acc =
        let check i =
            let rec loop i prev =
                if i = 0 then true else
                    if prev * (i land 1) = 1 then false else
                        loop (i lsr 1) (i land 1)
            in
            loop i 0
        in
        if i < 0 then acc else
            loop (i - 1) (if check i then i :: acc else acc)
    in
    let amidas = loop ((1 lsl (w - 1)) - 1) [] in
    let total = List.length amidas in
    let count = Array.make (w - 1) 0 in
    List.iter (fun v ->
        for t = 0 to w - 2 do
            if v land (1 lsl t) <> 0 then count.(t) <- count.(t) + 1
        done
    ) amidas;
    let m = 1_000_000_000 + 7 in
    let ( +@) a b = (a + b) mod m in
    let ( *@) a b = (a * b) mod m in
    let rec loop i arr =
        if i = h then arr.(k - 1) else
            let newarr = Array.init w (fun j ->
                let acc = if j > 0     then arr.(j - 1) *@ count.(j - 1) else 0 in
                let acc = if j < w - 1 then arr.(j + 1) *@ count.(j) + acc else acc in
                let v = if j > 0     then count.(j - 1) else 0 in
                let v = if j < w - 1 then count.(j) + v else v in
                acc +@ (total - v) *@ arr.(j)
            )
            in
            loop (i + 1) newarr
    in
    let init = Array.init w (fun i -> if i = 0 then 1 else 0) in
    loop 0 init |> Printf.printf "%d\n"
)