{-# 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] -> Int
        solve c xs [] = if minimum xs >= x then c else 0
        solve c xs (y:ys) = solve (c+(head $ vecs V.! y)) (zipWith (+) xs (tail $ vecs V.! y)) ys
    let ans =filter (\x -> x /= 0) $ map (solve 0 [0..]) pow 
    print $ if ans == [] then -1 else minimum ans