{-# LANGUAGE FlexibleContexts #-}
import Control.Monad
import Control.Monad.State
import Control.Monad.Reader
import Control.Arrow
-- import Control.Comonad
import Data.Maybe
import Data.List
import Data.Bool
import Data.Fixed
import Data.Tuple
import Data.Ratio
import Text.Printf
import qualified Data.Map.Strict as M
import qualified Data.Array.IO as IA
import qualified Data.Vector as V
 
getI = read <$> getLine :: IO Int
getIs = map read . words <$> getLine :: IO [Int]
getD = read <$> getLine :: IO Double
getDs = map read . words <$> getLine :: IO [Double]
getInt = read <$> getLine :: IO Integer
getInts = map read . words <$> getLine :: IO [Integer]
 
type Row = Integer
type Col = Integer
type PointI = (Integer, Integer)
type Point = (Int, Int)
 
mmm = 1000000007
fact n
    | n < 1 = 1
    | True = foldr1 (*) [1..n]
fi = fromInteger
fig = fromIntegral
rf = realToFrac
 
(.<.) f g -- combination
    | f < g = 0 
    | g < 1 || f < 1 = 1
    | True = foldr1 (*) (take g [f,f-1..]) `div` fact g
(.>.) f g --combination with repetition
    | g < 1 || f < 1 = 1
    | True = fact (f + g - 1) `div` (fact (f - 1) * fact g)
comb = (.<.)
combWp = (.>.)
 
unique a = unique_ (reverse . sort $ a) [] Nothing
    where
        unique_ [] arr _ = arr
        unique_ (x:xs) arr n
            | n == Just x = unique_ xs arr n
            | otherwise = unique_ xs (x:arr) $ Just x
 
zeroume keta num
    | (length . show $ num) > keta = show num
    | otherwise = do 
        let zeros = take keta $ repeat '0'
        reverse . take keta $ (reverse . show $ num) ++ zeros
 
i2b num
    | num < 2 = show num
    | otherwise = i2b_ num []
        where
            i2b_ num str
                | num == 0 = str
                | num == 1 = '1':str
                | otherwise = do
                    let next = num `div` 2
                    let this = if odd num then '1' else '0'
                    i2b_ next (this:str)
 
mapIncr = mapPlus 1
mapPlus n Nothing = Just n
mapPlus n a = (+) n <$> a
 
countIf f = length . filter f
 
-- 
--
--

countYokos w seeing
  | seeing >= w || seeing < 1 = 0
  | True = countAll (seeing - 1) * countAll (w - seeing - 1)

countStay w seeing
  | seeing > w || seeing < 1 = 0
  | True = countAll (seeing - 1) * countAll (w - seeing)

countAll w
  | w <= 1 = 1
  | True = countAll (w - 1) + countAll (w - 2)

makeAmida h w = do
  (amidaMap, nowH) <- get
  if nowH >= h then return amidaMap
  else do
    let molded = map (mold amidaMap) $ [1..w]
    let inserts = concat $ map (map (\(num, cnt) -> M.alter (mapPlus cnt >>> fmap (flip mod mmm)) num)) $ molded
    let newmp = foldr ($) M.empty inserts
    put (newmp, nowH + 1) >> makeAmida h w
    where
      countNext mp seeing = do
        let factor = M.findWithDefault 0 seeing mp
        let migi = countYokos w seeing * factor
        let hidari = countYokos w (seeing - 1) * factor
        let center = countStay w seeing * factor
        [hidari, center, migi]
      mold mp = (\x -> [x - 1, x, x + 1]) &&& countNext mp >>> uncurry zip
    
initAmida w = M.fromList $ zip [1..w] (1:[0,0..])
calcAmida h w = evalState (makeAmida h w) (initAmida w, 0)

main = do
  [h,w,k] <- getIs
  let mp = calcAmida h w 
  putStrLn . show . fromJust $ M.lookup k mp


Measured memory_bytes: 1404