{-# OPTIONS_GHC -O2 #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE Strict #-}
{-# LANGUAGE StrictData #-}
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as VM
import Data.Array.Unboxed
import Data.Array.ST
import qualified Data.ByteString.Char8 as BS
import Control.Monad
import Data.List
import Data.Char

powerSet :: [a] -> [[a]]
powerSet = filterM (\x -> [True,False]) 


main :: IO ()
main = do
    [n,m,x] <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
    vecs <- V.replicateM n $ unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
    let pow = (powerSet [0..n-1]) 
    let solve :: [Int] -> [Int] -> Int
        solve xs [] = if (minimum $ tail xs) >= x then head xs else 0
        solve xs (y:ys) = solve (zipWith (+) xs (vecs V.! y)) ys
    let ans =filter (\x -> x /= 0) $ map (solve (take (m+1) [0..])) pow 
    print $ if ans == [] then -1 else minimum ans