//10/05/2020
#include<bits/stdc++.h>
#include<cmath>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define debug printf("Debug\n");
#define en '\n'


#define ll long long
#define ull unsigned long long

#define pi acos(-1.0)
#define mod 1000000007

#define _fastio  ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define in_fre  freopen("in.txt", "r", stdin);
#define out_fre freopen("out.txt", "w", stdout);

struct Node{
    ll id;
    ll cost;
    vector<ll>v;
};

//Algos
template<typename T> using Pbds=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

//Number Theory
class NumberTheory{
public:
    ll n;
    bool chk[99999995];
    ll GetMod(ll x,ll m);
    ll BigMod (ll b,ll p,ll m){if (p == 0) return 1;if (p%2 == 0){ll s = BigMod(b,p/2,m);return ((s%m)*(s%m))%m;}return ((b%m)*(BigMod(b,p-1,m)%m))%m;}
    ll ModInv (ll b,ll m){return BigMod(b,m-2,m);}
    ll gcd(ll a,ll b){if(a<0)return gcd(-a,b);if(b<0)return gcd(a,-b);return (b==0)?a:gcd(b,a%b);}
    ll lcm(ll a,ll b) {if(a<0)return lcm(-a,b);if(b<0)return lcm(a,-b);return a*(b/gcd(a,b));}
    void sieve(ll x);
    bool IsPrime(ll x);
    bool IsPrime1(ll x){return !chk[x];}
};

/*Containers*/
vector<ll>v;
deque<ll>dq;
stack<ll>stk;
map<ll,ll>mp;
unordered_map<ll,ll>ump;
set<ll>st;
multiset<ll>mst;
unordered_set<ll>ust;
unordered_multiset<ll>umst;
priority_queue<ll,deque<ll>,greater<ll>>pq;
Pbds<ll>ost;

class Bitwise_operation{
public:
    ull a[65];
    ull A,B;
    bool check(ull N,ull pos){ return (bool)(N & (1LL<<pos)); }
    ull Set1(ull N,ull pos){ return N=N | (1LL<<pos); }
    ull Set0(ull N,ull pos){ return N=N & ~(1LL<<pos); }
    ull flip(ull N,ull pos){ return N=N ^ (1LL<<pos); }
    bool isPowerOf2(ull n){return !(n&(n-1))?true:false;}
    void swap(){ A = A ^ B;B = A ^ B;A = A ^ B;}
    ull FindLargestPowerof2(ull N){N=N|N>>1;N=N|N>>2;N=N|N>>4;N=N|N>>8;N=N|N>>16;N=N|N>>32; return(N+1)>>1;}
    ull GetRightmost1(ull x){return (x & (-x));}
    ull GetRightmost1spos(ull x){return __builtin_ffs(x)-1;}
    ll CountNumberof1s(ull x){ll cnt=0;while( x ){x = x&(x-1);cnt++;}return cnt;}
    ll CountLeadingZeros(ull x){return __builtin_clz(x);}
    ll CountTrailingZeros(ull x){return __builtin_ctz(x);}
    void possibleSubsets(ll N);

};

bool check(ull N,ull pos){ return (bool)(N & (1LL<<pos)); }

ll n,m,X;
Node a[20];

int main(){
    _fastio
    cin>>n>>m>>X;

    for(ll i=0;i<n;i++){
        Node x;
        x.id=1;
        cin>>x.cost;
        for(ll j=1;j<=m;j++){
            ll p;
            cin>>p;
            x.v.emplace_back(p);
        }
        a[i]=x;
    }

    ll cnt[15];
    ll ans=1e18;
    for(ll i=0;i<(1<<n);++i){
        memset(cnt,0,sizeof(cnt));
        ll tot=0;
        for(ll j=0;j<n;++j){
            if(check(i,j)){
                for(ll k=0;k<m;k++){
                    cnt[k]+=a[j].v[k];
                }
                tot+=a[j].cost;
            }
        }
        bool f=true;
        for(ll j=0;j<m;j++){
            if(cnt[j]<X) f=false;
        }
        if(f) ans=min(ans,tot);
    }

    if(ans==1e18) cout<<-1<<en;
    else cout<<ans<<en;



    return 0;
}

void Bitwise_operation::possibleSubsets(ll N){
    for(ll i = 0;i <(1 << N); ++i){
        for(ll j = 0;j < N;++j)
            if(check(i,j))
                cout << a[j]<<' ';
        cout << endl;
    }
}

void NumberTheory::sieve(ll x){
    for(ll i=2;i*i<=x;){
        if(chk[i]==0){
            for(ll j=i*i;j<=x;j+=i){
                chk[j]=1;
            }
        }
        if(i==2) i++;
        else i+=2;
    }
}
bool NumberTheory::IsPrime(ll x){
    bool f=true;
    for(ll i=2;i*i<=x;i++){
        if(!x%i){
            f=false;break;
        }
    }
}
ll GetMod(ll x,ll m){
    if(x>=0) return x%m;
    else{
        ll y=abs(x)/m;x+=(y*m+m+m);
        return x%m;
    }
}


Measured memory_bytes: 3660