"use strict";

const main = arg => {
    const input = arg.trim().split("\n");

    const [n,m,x] = input[0].split(" ").map(i => parseInt(i))
    let mat = []
    let costs = []
    for(let i =1; i<=n; i++){
        let tmp = input[i].split(" ").map(i => parseInt(i))
        costs[i] = tmp.shift()
        mat.push(tmp)   // [Ci, A(i,1), A(i,2),,,A(i, m)]
    }
  	let level = new Array(m).fill(0)
    let fee = Number.POSITIVE_INFINITY
    const helper = function(subLevel, subFee, seen){
        if(subLevel.every(i => i >= x)){
            fee = Math.min(fee, subFee)
        }
        for(let i = 1; i<=n ;i++){
            if(seen.has(i)) continue
            let tmpLevel  = [...subLevel]
            for(let j = 0; j<m; j++){
                tmpLevel[j] = tmpLevel[j] + mat[i-1][j]
            }
            seen.add(i)
            helper(tmpLevel, subFee+costs[i], seen)
            seen.delete(i)
        }
    }
    helper(level, 0, new Set())
    if(fee == Number.POSITIVE_INFINITY) console.log(-1)
    else console.log(fee)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));  

