function Main(input) {
  input = input.trim().split("\n").map(function(x) { return x.split(" ")});
  var L1 = input[0].map(e => (parseInt(e, 10)));
  var N = L1[0];
  var M = L1[1];
  var X = L1[2];
  var arr_CA = [];
  for (var i = 0; i < N; i++){
    arr_CA.push(input[i + 1].map(e => (parseInt(e, 10))));
  }
  var tmpRikaido = Array.from({ length: M }, () => 0); 
  var tmpAchievement = Array.from({ length: M }, () => false); 
  var tmpBookList = Array.from({ length: N }, () => 0); 
  var tmpPrice = 0;
  var tmp = 0;
  var ans = -1;
  for (var i = 0; i < Math.pow(2, N); i++){
    tmpRikaido = Array.from({ length: M }, () => 0); 
    tmpAchievement = Array.from({ length: M }, () => false); 
    tmpBookList = Array.from({ length: N }, () => 0); 
    tmpPrice = 0;
    tmp = i;
    for (var j = (N - 1); j >= 0; j--){
      tmpBookList[j] = (tmp / Math.pow(2,j) | 0);
      tmp -= Math.pow(2,j) * tmpBookList[j];
      if (tmpBookList[j]) {
        tmpPrice += arr_CA[j][0];
        for (var k = 0; k < M; k++){
          tmpRikaido[k] += arr_CA[j][k + 1];
          if (tmpRikaido[k] >= X) tmpAchievement[k] = true;
        }
      }
    }
    if (tmpAchievement.indexOf(false) === -1) {
      if ((ans === -1) || (ans > tmpPrice)) ans = tmpPrice;
    }
  }
  console.log(ans);
}   

Main(require("fs").readFileSync("/dev/stdin", "utf8"));