"use strict";

const main = arg => {
    const inputList = arg.trim().split("\n");
    // 回答を記述
    const nums = inputList[0].split(" ");

    const N = parseInt(nums[0]);
    const M = parseInt(nums[1]);
    const X = parseInt(nums[2]);

    // 参考書を別配列化
    let Books = []
    for (let i = 1; i <= N; i++) {
        Books.push(inputList[i].split(" ").map(ele => parseInt(ele)))
    }

    let answer = Infinity;
    let exist = false;

    // N冊の本を選ぶ選ばない=> 2 ** N 通り, 2 ** N = 1をNビット左シフト
    for (let i = 0; i < 2 ** N; i++) {
        let sumM = Array(M + 1).fill(0);
        for (let k = 0; k < N; k++) {
            if (i & (1 << k)) {
                // 配列には金額も含まれているので M + 1
                for (let j = 0; j < M + 1; j++) {
                    sumM[j] += Books[k][j];
                }
            }
        }
        // 合計金額を抜き出す
        const cost = sumM.shift();

        // 閾値を超えた要素数がM個あるか確認
        if (sumM.filter(ele => ele >= X).length === M) {
            exist = true;
            answer = Math.min(answer, cost);
        }
    }

    if (exist) {
        console.log(answer);
    } else {
        console.log(-1);
    }
}


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