function main(input){

  input = input.split('\n');
  const [N, M, X] = input[0].split(' ').map(Number);
  const list = input.slice(1, N+1).map(x => {
    const row = x.split(' ').map(Number);
    return {
      c: row[0],
      a: row.slice(1, M+1)
    }
  });

  let min = -1;
  for(let n=1; n<=2**N; n++){
    let sum = 0;
    let a = [];
    for(let i=0; i<M; i++){
      a.push(0);
    }
    for(let i=0; i<N; i++){
      if((n>>i & 1) == 1){
        sum += list[i].c;
        for(let j=0; j<M;j++){
          a[j] += list[i].a[j];
        }
      }
    }
    if(!a.every(x=> x >= X)) continue;
    if ((sum < min) || (min==-1)){
      min = sum;
    }
  }

  console.log(min);

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