"use strict";

const genPatten = function (n) {
    let ret = []
    const helper = function (sub) {
        if (sub.length == n) {
            ret.push([...sub])
            return
        }
        helper([...sub, true])
        helper([...sub, false])
    }
    helper([])
    return ret
}

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 - 1] = tmp.shift()
        mat.push(tmp)   // [Ci, A(i,1), A(i,2),,,A(i, m)]
    }
    let pats = genPatten(n)
    
    let fee = Number.POSITIVE_INFINITY
    for (let pat of pats) {
        let tmp = 0
        let level = new Array(m).fill(0)
        for (let i = 0; i < n; i++) {
            if (pat[i]) {
                tmp = tmp + costs[i]
                for (let j = 0; j < m; j++) {
                    level[j] = level[j] + mat[i][j]
                }
            }
        }
        if (level.every(el => el >= x)) {
            fee = Math.min(fee, tmp)
        }
    }
    if (fee == Number.POSITIVE_INFINITY) console.log(-1)
    else console.log(fee)
}

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

