"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const M = parseInt(arg[0].split(" ")[1]);
    const K = parseInt(arg[0].split(" ")[2]);

    const CA = arg.slice(1, N + 1).map(n=>n.split(" ").map(l=>parseInt(l)));
    
    let exist = false;
    let answer = Infinity;
    
    for(let bit=0; bit<(1<<N); bit++) {
        let sum = [...Array(M)].fill(0);
        
        for(let i=0; i<N; i++) {
            if(bit & (1 << i)) {
                for(let j=0; j<M; j++) {
                    sum[j] += CA[i][j];
                }
                
                // console.log("sum:" + sum);
            }
        }
        
        if(sum.filter(n=>n>=K).length === M) {
            exist  = true;
            answer = Math.min(answer, sum[0]); 
        }
    }
    
    if(exist) {
        console.log(answer);
    } else {
        console.log(-1);
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));