#include<bits/stdc++.h>
using namespace std;
using ll  = long long;
using vvl = vector<vector<ll>>;
using vl  = vector<ll>;
#define _GLIBCXX_DEBUG
#define acc_io cin.tie(0);ios::sync_with_stdio(false)
#define all(x) x.begin(),x.end()
#define rep(i,sta,end) for(ll i=sta;i<end;i++)
#define lcm(a,b) (a)/__gcd((a),(b))*(b)
#define pb push_back
const ll MOD = 1000000007;
const double PI = acos(-1);  
//name[i]   -> vl  name(i)
//name[i][j]-> vvl name(i,vl(j))
//or-> ||
//map<int,int>mp

ll n,m,x;
ll c[12];
ll a[12][12];
ll ans;
//string s;
void dfs(int i,ll mny,ll skl[12]){

	if(i==n){
		return;
	}
//	cout<<i<<" "<<mny<<" "<<endl;
//	rep(i,0,m) cout<<skl[i]<<" ";
//	cout<<endl;

	int ok=1;
	ll skl_tmp[m];
	ll mny_tmp;
	mny_tmp=mny+c[i];
	rep(k,0,m){
		skl_tmp[k]=skl[k]+a[i][k];
		if(skl_tmp[k]<x) ok=0;
	}
	if(ok){
		if(ans>mny_tmp) ans=mny_tmp;
	}
    dfs(i+1,mny,skl);
    dfs(i+1,mny_tmp,skl_tmp);
	return;
}

signed main(){
	acc_io;
	cin>>n>>m>>x;
	rep(i,0,n){
		cin>>c[i];
		rep(j,0,m){
			cin>>a[i][j];
		}
	}
	ans=1e9;
	ll skl[12]={0};
	dfs(0,0,skl);
	if(ans==1e9) ans=-1;
	cout<<ans<<endl;
	return 0;
}
