process.stdin.resume();
process.stdin.setEncoding('utf8');
var lines = [];
var reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout,
    terminal: false
});
reader.on('line', (line) => {
    lines.push(line);
});
reader.on('close', () => {
    // const [a, b, c, k] = lines[0].split(" ").map(e => parseInt(e));
    // //lines.shift();
    // const t = k - (a + b);
    // console.log( t <= 0 ? a : (a - t));

    // 組合せ
    const combination = (nums, k) => {
        let ans = [];
        if (nums.length < k) {
            return [];
        }
        if (k === 1) {
            for (let i = 0; i < nums.length; i++) {
                ans[i] = [nums[i]];
            }
        } else {
            for (let i = 0; i < nums.length - k + 1; i++) {
                let row = combination(nums.slice(i + 1), k - 1);
                for (let j = 0; j < row.length; j++) {
                    ans.push([nums[i]].concat(row[j]));
                }
            }
        }
        return ans;
    }

    const [N, M, X] = lines[0].split(" ").map(e => parseInt(e));
    lines.shift();
    const datas = lines.map(e => e.split(" ").map(e1 => parseInt(e1)));

    let list = [];
    for (let i = 1; i <= N; i++) {
        list = list.concat(combination(datas, i));
    }
    //console.log(list);

    const transpose = mtx => mtx[0].map((_, c) => mtx.map(r => r[c]));
    const list1 = list.map(e => {
        const sumlist = transpose(e);
        return sumlist.map(e => e.reduce((a, c) => a + c, 0));
    });
    //console.log(list1);

    const list2 = list1.filter(e => {
        const [c, ...algs] = e;
        return algs.every(e1 => e1 >= X);
    });
    
    if (list2.length === 0) {
        console.log(-1);
    } else {
        console.log(list2.map(e => e[0]).reduce((a, c) => a < c ? a : c));
    }
});