#include <bits/stdc++.h>
using namespace std;
// x^y≡x^(y%(p-1))mod p
// but there is a condition that x needs to be coprime to p
///assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) is(65-90) and 32 for space
typedef long long int ll;
typedef pair<ll, ll> pii;
typedef vector<pii> vii;
#define  pb push_back
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fo(i,a,b) for(ll i = a; i<=b;i+=1)
#define rf(i,a,b)  for(ll i=a;i>=b;i--)
#define vll vector<ll>
#define tests() int test_cases ; cin >> test_cases ; while(test_cases--)
#define ub upper_bound
#define lb lower_bound
#define all(v) v.begin(),v.end()
#define MAXN 100010
#define MOD 1000000007
#define mod 998244353
#define deb(x) cout << '>' << #x << ':' << x << endl;
#define sp " "
#define MS(x,y) fill_n(*x, sizeof x / sizeof **x, y);
#define mem(x,y) memset(x,y,sizeof(x));
#define INF 1000000000000000000
#define IO                 \
	ios::sync_with_stdio(0); \
	cin.tie(0);              \
	cout.tie(0);
#define debug(x) cerr << (#x) << " is " << (x) << endl;

#ifndef ONLINE_JUDGE
#define cerr if(true)cerr
#endif

template<int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
static_assert(D >= 1, "Vector dimension must be greater than zero!");
template<typename... Args>
	Vec(int n = 0, Args... args) : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {
	}
};
template<typename T>
struct Vec<1, T> : public vector<T> {
	Vec(int n = 0, const T& val = T()) : vector<T>(n, val) {
	}
};

ll power(ll x, ll y,ll p) 
{ 
    ll res = 1;     // Initialize result 
    x = x % p;
    if (y==0)return 1;
    if(x==0)return 0;   
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p;    
        y = y>>1; // y = y/2 
        x = (x*x) % p;  // Change x to x^2 
    } 
    return res; 
}
int gcd(int a, int b) { if (a == 0)return b;return gcd(b % a, a);} 

ll modinv(ll a,ll p){return power(a,p-2,p);}
ll arr[15][15];
ll n,m,x;
ll mn = INF;
vll c(15);
void generate_subset(ll val = 0,ll index = 0){
    if (index==n)
    {
        ll num = val;
        vll skill(m,0);
        ll cnt = 0;
        ll ans = 0;
        while(num>0){
            if (num%2)
            {
                f(j,0,m){
                    skill[j]+=arr[cnt][j];
                    
                }
                ans+=c[cnt];
            }
            // deb(num%2)
            num/=2;
            cnt++;
        }
        bool corr = true;
        f(i,0,m){
            if (skill[i]<x)
            {
                corr = false;
            }
        }
        if (corr)
        {
            mn =min(mn,ans);
        }
        // deb(val)
        return ;
    }
    generate_subset(val*2+1,index+1);
    generate_subset(val*2,index+1);
    return ;
}
int solve(){
    cin>>n>>m>>x;
    f(i,0,n){
        cin>>c[i];
        f(j,0,m){
            cin>>arr[i][j];
        }
    }
    generate_subset();
    if (mn!=INF)
    {
        cout<<mn<<endl; 
    }
    else cout<<-1<<endl;
    return 0;
}
int main()
{
    IO;
    #ifndef ONLINE_JUDGE 
    freopen("input.txt", "r", stdin); 
    freopen("out.txt", "w", stdout); 
    #endif 
    int T=1;
	// cin >> T;
	f(c,0,T){
		solve();
	}
    return 0;
}// make_pair make_tuple  tuple<int,int,int> continue resize insert count size else true isValid second first

Measured memory_bytes: 3656