#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;

int main(){
  int n,m,x;
  cin >>n >>m >>x;
  int a[12][12];
  vector<int> c(n);
  rep(i,n){
    cin >>c[i];
    rep(j,m){
      cin >>a[i][j];
    }
  }
  int ans = 100100100;
  rep(s,1<<n){
    int cost = 0;
    vector<int> d(m);
    rep(i,n){
      if(s>>i&1){
        cost += c[i];
        rep(j,m) d[j] += a[i][j];
      }
    }
    bool ok = true;
    rep(j,m){
      if(d[j]<x) ok = false;
    }
    if(ok && ans>cost) ans = cost;
  }
  if(ans==100100100) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}
