import numpy as np





MOD = 10**9 + 7

def powmod(mat, n, mod):

    result = np.eye(len(mat), dtype=np.int64)

    while n > 0:

        if n & 1:

            result = np.dot(result, mat) % mod

        mat = np.dot(mat, mat) % mod

        n >>= 1

    return result





H, W, K = [int(elem) for elem in input().split()]

trans_mat = np.zeros((W, W), dtype=np.int64)

initial_vec = np.zeros(W, dtype=np.int64)

initial_vec[0] = 1



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

    flag = False

    for pos in range(W - 2):

        if (i >> pos & 1) and (i >> (pos + 1) & 1):

            flag = True

    if flag:

        continue

    for pos in range(W):

        if pos == 0:

            if i & 1:

                trans_mat[0, 1] += 1

            else:

                trans_mat[0, 0] += 1

        elif pos == W - 1:

            if (i >> W - 2) & 1:

                trans_mat[W - 1, W - 2] += 1

            else:

                trans_mat[W - 1, W - 1] += 1

        else:

            if (i >> (pos - 1)) & 1:

                trans_mat[pos, pos - 1] += 1

            elif (i >> pos) & 1:

                trans_mat[pos, pos + 1] += 1

            else:

                trans_mat[pos, pos] += 1



powed_mat = powmod(trans_mat, H, MOD)

print((np.dot(powed_mat, initial_vec)[K - 1] % MOD))

# time complexity: O(HW2^W)

# space complexity: O(HW)



def violates(w_flags):

    prev_flag = w_flags & 1

    for shift in range(1, W - 1):

        flag = w_flags >> shift & 1

        if flag and prev_flag:

            return True

        prev_flag = flag

    return False





H, W, K = [int(elem) for elem in input().split()]

MOD = 10**9 + 7



if W == 1:

    print((1))

    exit(0)



dp = [[0] * W for _ in range(H + 1)]

dp[0][0] = 1



for h in range(1, H + 1):

    for w_flags in range(2**(W - 1)):

        if violates(w_flags):

            continue

        for w in range(W):

            if w == 0:

                if w_flags & 1:

                    dp[h][0] += dp[h - 1][1]

                else:

                    dp[h][0] += dp[h - 1][0]

            elif w == W - 1:

                if w_flags >> W - 2 & 1:

                    dp[h][W - 1] += dp[h - 1][W - 2]

                else:

                    dp[h][W - 1] += dp[h - 1][W - 1]

            else:

                if w_flags >> w - 1 & 1:

                    dp[h][w] += dp[h - 1][w - 1]

                elif w_flags >> w & 1:

                    dp[h][w] += dp[h - 1][w + 1]

                else:

                    dp[h][w] += dp[h - 1][w]

            dp[h][w] %= MOD



print((dp[-1][K - 1]))

import numpy as np

MOD = 10**9 + 7


def powmod(mat, n, mod):
    result = np.eye(len(mat), dtype=np.int64)
    while n > 0:
        if n & 1:
            result = np.dot(result, mat) % mod
        mat = np.dot(mat, mat) % mod
        n >>= 1
    return result


H, W, K = [int(elem) for elem in input().split()]
trans_mat = np.zeros((W, W), dtype=np.int64)
initial_vec = np.zeros(W, dtype=np.int64)
initial_vec[0] = 1
for i in range(2 ** (W - 1)):
    flag = False
    for pos in range(W - 2):
        if (i >> pos & 1) and (i >> (pos + 1) & 1):
            flag = True
    if flag:
        continue
    for pos in range(W):
        if pos == 0:
            if i & 1:
                trans_mat[0, 1] += 1
            else:
                trans_mat[0, 0] += 1
        elif pos == W - 1:
            if (i >> W - 2) & 1:
                trans_mat[W - 1, W - 2] += 1
            else:
                trans_mat[W - 1, W - 1] += 1
        else:
            if (i >> (pos - 1)) & 1:
                trans_mat[pos, pos - 1] += 1
            elif (i >> pos) & 1:
                trans_mat[pos, pos + 1] += 1
            else:
                trans_mat[pos, pos] += 1
powed_mat = powmod(trans_mat, H, MOD)
print((np.dot(powed_mat, initial_vec)[K - 1] % MOD))

# time complexity: O(HW2^W)
# space complexity: O(HW)
def violates(w_flags):
    prev_flag = w_flags & 1
    for shift in range(1, W - 1):
        flag = w_flags >> shift & 1
        if flag and prev_flag:
            return True
        prev_flag = flag
    return False


H, W, K = [int(elem) for elem in input().split()]
MOD = 10**9 + 7
if W == 1:
    print((1))
    exit(0)
dp = [[0] * W for _ in range(H + 1)]
dp[0][0] = 1
for h in range(1, H + 1):
    for w_flags in range(2 ** (W - 1)):
        if violates(w_flags):
            continue
        for w in range(W):
            if w == 0:
                if w_flags & 1:
                    dp[h][0] += dp[h - 1][1]
                else:
                    dp[h][0] += dp[h - 1][0]
            elif w == W - 1:
                if w_flags >> W - 2 & 1:
                    dp[h][W - 1] += dp[h - 1][W - 2]
                else:
                    dp[h][W - 1] += dp[h - 1][W - 1]
            else:
                if w_flags >> w - 1 & 1:
                    dp[h][w] += dp[h - 1][w - 1]
                elif w_flags >> w & 1:
                    dp[h][w] += dp[h - 1][w + 1]
                else:
                    dp[h][w] += dp[h - 1][w]
            dp[h][w] %= MOD
print((dp[-1][K - 1]))

-import numpy as np - -MOD = 10**9 + 7 - - -def powmod(mat, n, mod): -    result = np.eye(len(mat), dtype=np.int64) -    while n > 0: -        if n & 1: -            result = np.dot(result, mat) % mod -        mat = np.dot(mat, mat) % mod -        n >>= 1 -    return result +# time complexity: O(HW2^W) +# space complexity: O(HW) +def violates(w_flags): +    prev_flag = w_flags & 1 +    for shift in range(1, W - 1): +        flag = w_flags >> shift & 1 +        if flag and prev_flag: +            return True +        prev_flag = flag +    return False -trans_mat = np.zeros((W, W), dtype=np.int64) -initial_vec = np.zeros(W, dtype=np.int64) -initial_vec[0] = 1 -for i in range(2 ** (W - 1)): -    flag = False -    for pos in range(W - 2): -        if (i >> pos & 1) and (i >> (pos + 1) & 1): -            flag = True -    if flag: -        continue -    for pos in range(W): -        if pos == 0: -            if i & 1: -                trans_mat[0, 1] += 1 +MOD = 10**9 + 7 +if W == 1: +    print((1)) +    exit(0) +dp = [[0] * W for _ in range(H + 1)] +dp[0][0] = 1 +for h in range(1, H + 1): +    for w_flags in range(2 ** (W - 1)): +        if violates(w_flags): +            continue +        for w in range(W): +            if w == 0: +                if w_flags & 1: +                    dp[h][0] += dp[h - 1][1] +                else: +                    dp[h][0] += dp[h - 1][0] +            elif w == W - 1: +                if w_flags >> W - 2 & 1: +                    dp[h][W - 1] += dp[h - 1][W - 2] +                else: +                    dp[h][W - 1] += dp[h - 1][W - 1] -                trans_mat[0, 0] += 1 -        elif pos == W - 1: -            if (i >> W - 2) & 1: -                trans_mat[W - 1, W - 2] += 1 -            else: -                trans_mat[W - 1, W - 1] += 1 -        else: -            if (i >> (pos - 1)) & 1: -                trans_mat[pos, pos - 1] += 1 -            elif (i >> pos) & 1: -                trans_mat[pos, pos + 1] += 1 -            else: -                trans_mat[pos, pos] += 1 -powed_mat = powmod(trans_mat, H, MOD) -print((np.dot(powed_mat, initial_vec)[K - 1] % MOD)) +                if w_flags >> w - 1 & 1: +                    dp[h][w] += dp[h - 1][w - 1] +                elif w_flags >> w & 1: +                    dp[h][w] += dp[h - 1][w + 1] +                else: +                    dp[h][w] += dp[h - 1][w] +            dp[h][w] %= MOD +print((dp[-1][K - 1]))