l=[[] for i in range(9)]

l[1]=[""]

l[2]=["0","1"]

for i in range(3,9):

    for s in l[i-1]:

        l[i].append("0"+s)

        if s[0]!="1":

            l[i].append("1"+s)



mod=1000000007

s=input().split()

h,w,k=int(s[0]),int(s[1]),int(s[2])

dp=[[0]*(w) for i in range(h+1)]

dp[0][0]=1

for i in range(h):

    for s in l[w]:

        s="0"+s+"0" #どの縦棒から見ても左右が参照できるように両端に0をつけておく

        for j in range(w):

            if s[j]=="0" and s[j+1]=="0": #直進

                dp[i+1][j]+=dp[i][j]

                dp[i+1][j]%=mod

            if s[j]=="0" and s[j+1]=="1": #左列に移る

                dp[i+1][j+1]+=dp[i][j]

                dp[i+1][j+1]%=mod

            if s[j]=="1" and s[j+1]=="0": #右列に移る

                dp[i+1][j-1]+=dp[i][j]

                dp[i+1][j-1]%=mod

print((dp[h][k-1]))
import numpy as np



mod=1000000007

s=input().split()

h,w,k=int(s[0]),int(s[1]),int(s[2])

l=[]

for i in range(2**(w-1)):

    s=bin(i)[2:].zfill(w-1)

    if s.find("11")==-1:

        l.append(s)

mat=np.zeros((w,w),dtype="int64")

for s in l:

    dest=[i for i in range(w)]

    for i in range(w-1):

        if s[i]=="1":

                dest[i],dest[i+1]=dest[i+1],dest[i]

    for i in range(w):

        mat[i][dest[i]]+=1

res=np.zeros(w,dtype="int64")

res[0]=1

for i in range(h):

    res=np.dot(mat,res)

    for i in range(w):

        res[i]%=mod

print((res[k-1]))
l = [[] for i in range(9)]
l[1] = [""]
l[2] = ["0", "1"]
for i in range(3, 9):
    for s in l[i - 1]:
        l[i].append("0" + s)
        if s[0] != "1":
            l[i].append("1" + s)
mod = 1000000007
s = input().split()
h, w, k = int(s[0]), int(s[1]), int(s[2])
dp = [[0] * (w) for i in range(h + 1)]
dp[0][0] = 1
for i in range(h):
    for s in l[w]:
        s = "0" + s + "0"  # どの縦棒から見ても左右が参照できるように両端に0をつけておく
        for j in range(w):
            if s[j] == "0" and s[j + 1] == "0":  # 直進
                dp[i + 1][j] += dp[i][j]
                dp[i + 1][j] %= mod
            if s[j] == "0" and s[j + 1] == "1":  # 左列に移る
                dp[i + 1][j + 1] += dp[i][j]
                dp[i + 1][j + 1] %= mod
            if s[j] == "1" and s[j + 1] == "0":  # 右列に移る
                dp[i + 1][j - 1] += dp[i][j]
                dp[i + 1][j - 1] %= mod
print((dp[h][k - 1]))

import numpy as np

mod = 1000000007
s = input().split()
h, w, k = int(s[0]), int(s[1]), int(s[2])
l = []
for i in range(2 ** (w - 1)):
    s = bin(i)[2:].zfill(w - 1)
    if s.find("11") == -1:
        l.append(s)
mat = np.zeros((w, w), dtype="int64")
for s in l:
    dest = [i for i in range(w)]
    for i in range(w - 1):
        if s[i] == "1":
            dest[i], dest[i + 1] = dest[i + 1], dest[i]
    for i in range(w):
        mat[i][dest[i]] += 1
res = np.zeros(w, dtype="int64")
res[0] = 1
for i in range(h):
    res = np.dot(mat, res)
    for i in range(w):
        res[i] %= mod
print((res[k - 1]))

-l = [[] for i in range(9)] -l[1] = [""] -l[2] = ["0", "1"] -for i in range(3, 9): -    for s in l[i - 1]: -        l[i].append("0" + s) -        if s[0] != "1": -            l[i].append("1" + s) +import numpy as np + -dp = [[0] * (w) for i in range(h + 1)] -dp[0][0] = 1 +l = [] +for i in range(2 ** (w - 1)): +    s = bin(i)[2:].zfill(w - 1) +    if s.find("11") == -1: +        l.append(s) +mat = np.zeros((w, w), dtype="int64") +for s in l: +    dest = [i for i in range(w)] +    for i in range(w - 1): +        if s[i] == "1": +            dest[i], dest[i + 1] = dest[i + 1], dest[i] +    for i in range(w): +        mat[i][dest[i]] += 1 +res = np.zeros(w, dtype="int64") +res[0] = 1 -    for s in l[w]: -        s = "0" + s + "0"  # どの縦棒から見ても左右が参照できるように両端に0をつけておく -        for j in range(w): -            if s[j] == "0" and s[j + 1] == "0":  # 直進 -                dp[i + 1][j] += dp[i][j] -                dp[i + 1][j] %= mod -            if s[j] == "0" and s[j + 1] == "1":  # 左列に移る -                dp[i + 1][j + 1] += dp[i][j] -                dp[i + 1][j + 1] %= mod -            if s[j] == "1" and s[j + 1] == "0":  # 右列に移る -                dp[i + 1][j - 1] += dp[i][j] -                dp[i + 1][j - 1] %= mod -print((dp[h][k - 1])) +    res = np.dot(mat, res) +    for i in range(w): +        res[i] %= mod +print((res[k - 1]))