'use strict';
function Main(inputs) {
  // 1行目がinput[0], 2行目がinput[1], …に入る
  const input = inputs.split("\n");
  const [n, m, x] = input[0].split(' ').map(Number);
  const c = [];
  const a = [];
  for(let i = 0; i < n; i++){
    const line = input[i + 1].split(' ');
    c.push(Number(line[0]));
    a.push(line.slice(1).map(Number));
  }
  const INITIAL = 1e7;
  let minCost = INITIAL;
  for(let i = 0; i < 1 << n; i++){
    const skill = Array(m).fill(0);
    let cost = 0;
    for(let j = 0; j < n; j++){
      const bit = 1 << j;
      const exist = (bit & i) === bit;
      if(exist){
        cost += c[j];
        for(let k = 0; k < m; k++){
          skill[k] += a[j][k];
        }
      }
    }
    if(skill.every((s) => s >= x)){
      minCost = Math.min(minCost, cost);
    }
  }
  console.log(minCost === INITIAL ? -1 : minCost);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
