#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
// #include<C:\Users\J\Desktop\AC\athead.h>
#define showa(v) for(int iii = 0; iii < v.size(); iii++){ cout << v[iii] << " ";} cout << endl;
#define show(iiii) cout << iiii << endl; 
#define shows(iiiii) cout << iiiii << " ";
#include<iostream>
#include<string>
#include<vector>
// #include<stdio.h>
#include <cmath>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <set>
#include <deque>
#include <numeric>
#include<tuple>
#include <utility>
#include <map>
#include <cassert>
#include<unordered_set>
using namespace std;

 
int main(){
    int n, m, x;
    cin >> n >> m >> x;
    vector<int> c(n);
    vector<vector<int>> a(n, vector<int>(m));
    vector<int> suma(m, 0);
    rep(i,n){
        cin >> c[i];
        rep(j,m){
            cin >> a[i][j];         
            suma[j] += a[i][j];
        }
    }

    rep(j,m){
        if(suma[j] < x){
            cout << -1 << endl;
            return 0;
        }
    }
    vector<vector<int>> pool;
    vector<int> sumcs;
    vector<bool> use;
    for (int bit = 0; bit < (1<<n); ++bit) {
            // vector<int> S;
            int sumc = 0;
            vector<int> Si;
            for (int i = 0; i < n; ++i) {
                if (bit & (1<<i)) { // 列挙に i が含まれるか
                    // S.push_back(a[i][j]);
                    Si.push_back(i);
                    sumc+=c[i];
                }
            }
            pool.push_back(Si);
            sumcs.push_back(sumc);
            use.push_back(true);
        }

    rep(j,m){
        vector<int> buf(n);
        rep(i,n) buf[i] = a[i][j];
        rep(k, pool.size()){
            if(use[k]){
                int summ = 0;
                rep(kk, pool[k].size()){
                    summ += a[pool[k][kk]][j];
                }
                if(summ < x) use[k] = false;
            }          
        }
    }
    int minc = 10001;
    rep(k, use.size()){
        if(use[k]){
            if(minc > sumcs[k]){
                minc = sumcs[k];
            }
        }
    }
    cout << minc << endl;



}