#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
mod util {
    use std::fmt::Debug;
    use std::io::{stdin, stdout, BufWriter, StdoutLock};
    use std::str::FromStr;
    #[allow(dead_code)]
    pub fn line() -> String {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().to_string()
    }
    #[allow(dead_code)]
    pub fn chars() -> Vec<char> {
        line().chars().collect()
    }
    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }
    #[allow(dead_code)]
    pub fn with_bufwriter<F: FnOnce(BufWriter<StdoutLock>) -> ()>(f: F) {
        let out = stdout();
        let writer = BufWriter::new(out.lock());
        f(writer)
    }
}
#[allow(unused_macros)]
macro_rules ! get { ( [ $ t : ty ] ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . split_whitespace ( ) . map ( | t | t . parse ::<$ t > ( ) . unwrap ( ) ) . collect ::< Vec < _ >> ( ) } } ; ( [ $ t : ty ] ; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( [ $ t ] ) ) . collect ::< Vec < _ >> ( ) } ; ( $ t : ty ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . trim ( ) . parse ::<$ t > ( ) . unwrap ( ) } } ; ( $ ( $ t : ty ) ,* ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; let mut iter = line . split_whitespace ( ) ; ( $ ( iter . next ( ) . unwrap ( ) . parse ::<$ t > ( ) . unwrap ( ) , ) * ) } } ; ( $ t : ty ; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ ( $ t : ty ) ,*; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ ( $ t ) ,* ) ) . collect ::< Vec < _ >> ( ) } ; }
#[allow(unused_macros)]
macro_rules ! debug { ( $ ( $ a : expr ) ,* ) => { eprintln ! ( concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) ; } }
const BIG_STACK_SIZE: bool = true;
#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}
#[allow(dead_code)]
fn read<T>() -> Vec<T>
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|s| s.trim().parse().unwrap())
        .collect()
}

fn solve() {
    let (h, w, k) = get!(usize, usize, usize);

    if w == 1 {
        println!("1");
        return;
    }

    let mo = 1_000_000_007;

    let mut dp = vec![vec![0u64; w]; h+1];
    dp[0][0] = 1;
    
    for row in 0..h {
        for col in 0..w {
            let mut l = 0;
            let mut r = 0;
            let mut n = 0;
            for pat in 0..(1<<(w-1)) {
                let mut tmp = pat;
                let mut flag = false;
                while tmp > 0 {
                    flag = tmp % 2 == 1 && (tmp/2) % 2 == 1;
                    if flag {
                        break;
                    }
                    tmp >>= 1;
                }
                if flag {
                    continue;
                }
                if col == 0 {
                    if pat % 2 == 1 {
                        r += 1;
                    } else {
                        n += 1;
                    }
                } else if (pat >> col) % 2 == 1 {
                    r += 1;
                } else if (pat >> (col-1)) % 2 == 1 {
                    l += 1;
                } else {
                    n += 1;
                }
            }
            dp[row+1][col] += n * dp[row][col];
            dp[row+1][col] %= mo;
            if col >  0  && col < w-1 {
                dp[row+1][col-1] += l * dp[row][col];
                dp[row+1][col+1] += r * dp[row][col];
                dp[row+1][col-1] %= mo;
                dp[row+1][col+1] %= mo;
            } else if col == 0 {
                dp[row+1][col+1] += r * dp[row][col];
                dp[row+1][col+1] %= mo;
            } else {
                dp[row+1][col-1] += l *  dp[row][col];
                dp[row+1][col-1] %= mo;
            }
        }
    }
    println!("{}", dp[h][k-1]);
}


Measured memory_bytes: 8572