#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define fastio                      \
  ios_base::sync_with_stdio(false); \
  cin.tie(NULL);
#define NO cout << "NO" << endl
#define YES cout << "YES" << endl
#define vec vector<ll>
#define pi pair<ll, ll>
#define intarr(arr, n)       \
  ll arr[n];                 \
  for (ll i = 0; i < n; i++) \
  cin >> arr[i]
#define loop(i, a, b, c) for (ll i = a; i < b; i += c)
#define pb push_back
#define mkp make_pair
#define printarr(arr, n)     \
  for (ll i = 0; i < n; i++) \
  {                          \
    cout << arr[i] << " ";   \
  }                          \
  cout << endl
#define endl "\n"
#define MOD 1000000007
#define mem(dp, a) memset(dp, a, sizeof(dp));
#define all(v) v.begin(), v.end()
ll Ceil(ll a, ll b)
{
  if (a % b == 0)
    return a / b;
  else
    return a / b + 1;
}
ll gcd(ll a, ll b)
{
  if (b == 0)
    return a;
  return gcd(b, a % b);
}
bool isSubSequence(string str1, string str2, int m, int n)
{
  if (m == 0)
    return true;
  if (n == 0)
    return false;
  if (str1[m - 1] == str2[n - 1])
    return isSubSequence(str1, str2, m - 1, n - 1);
  return isSubSequence(str1, str2, m, n - 1);
}

bool SieveOfEratosthenes(ll n)
{
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));

  for (ll p = 2; p * p <= n; p++)
  {
    if (prime[p] == true)
    {
      for (ll i = p * p; i <= n; i += p)
        prime[i] = false;
    }
  }
  return prime[n];
  // for (int p=2; p<=n; p++)
  //    if (prime[p])
  //       cout << p << " ";
}

// unordered_map<ll,vec> m,final;
// map<ll,ll> height,subtree;
// unordered_map<ll,bool> visited;

// void noOfNodesInEachSubtree(ll s,ll e){
//   subtree[s]=final[s].size();
//   for(ll i=0;i<final[s].size();i++){
//     if(final[s][i]==e) continue;
//     subtreefunc(final[s][i],s);
//     subtree[s]+=subtree[final[s][i]];
//   }
//   return;
// }

// void dfs(){
//   height[1]=0;
//   queue<ll> q;
//   q.push(1);
//   visited[1]=true;
//   while(!q.empty()){
//     ll f=q.front();
//     for(ll i=0;i<m[f].size();i++){
//       if(!visited[m[f][i]]){
//         final[f].pb(m[f][i]);
//         height[m[f][i]]=height[f]+1;
//         visited[m[f][i]]=true;
//         q.push(m[f][i]);
//       }
//     }
//     q.pop();
//   }
//   subtreefunc(1,0);
//   for(auto i:subtree)
//       i.second--;

// }

bool isPrime(ll n)
{
  // Corner cases
  if (n <= 1)
    return false;
  if (n <= 3)
    return true;

  // This is checked so that we can skip
  // middle five numbers in below loop
  if (n % 2 == 0 || n % 3 == 0)
    return false;

  for (ll i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0)
      return false;

  return true;
}

bool cmp(pair<ll, ll> a, pair<ll, ll> b)
{
  return a.first < b.first;
}

ll c[20][20];
ll ans=INT_MAX;
void calculate(ll n,ll m,ll x,ll *sum,ll j,ll abc)
{
    if(j==n){
        ll flag=0;
        for(ll i=1;i<=m;i++){
            if(sum[i]<x){
                flag=1;
                //wvn;rhnw;vourpbviw;rbvp;wibvr[iwrbv[i'wr]]
                break;
            }
        }
        //vwekkbcwk;rbvpwivn[wirbvkfjv pierbvnwrke]
        if(flag==0){
            ans=min(ans,abc);
        }
        return;
    }
    //adkjlshglicubrwipbvirwubviphwrbvpkjerwbvoeiprv
    abc+=c[j][0];
    for(ll i=1;i<=m;i++)
    {
        sum[i]+=c[j][i];
    }
    //vwrphf;rwiubvr;iwvbprwibvperivbprivber
    calculate(n,m,x,sum,j+1,abc);
     abc-=c[j][0];
    for(ll i=1;i<=m;i++)
    {
      //wrlfohbfvolbfroerbvpeihbvpeihbvepibv[ie']
        sum[i]-=c[j][i];
    }
    calculate(n,m,x,sum,j+1,abc);
    //ewr;fbelrvhbelvhbepqgibeprihger
}
void solve() 
{
    ll n,m,x;
    cin>>n>>m>>x;
    for(ll i=0;i<n;i++)
    {
        for(ll j=0;j<=m;j++)
        {
          //wrlfiwrfihbevrlirwhqbvpiwqrybfeiqrbgpqgib
            cin>>c[i][j];
        }
    }
    ll sum[m+1];
    mem(sum,0);
    //wkfhqegbfwolqefbvowgfvuworuf
    calculate(n,m,x,sum,0,0);
    if(ans==INT_MAX) cout<<-1;
    else cout<<ans;
}

int main()
{
  fastio;
  ll t;
  t = 1;
  //cin >> t;
  //ll sum = 0;
  //func();

  //cout<<gcd(4,9)<<endl

  while (t--)
  {
    //ll next = solve();
    //cout<<next<<endl;
    //sum += next;
    solve();
    //solve2();
  }
  //cout << sum;
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";

  return 0;
}


Measured memory_bytes: 3676