#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define fi first
#define se second
using namespace std;


typedef long long ll;
const int INF = 1001001001;



int main() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif
	// int t;
	// cin >> t;
	// while (t--) {
	int n, m, x; cin >> n >> m >> x;
	vector<int> c(n);
	int a[12][12];

	rep(i, n) {
		cin >> c[i];
		rep(j, m) cin >> a[i][j];
	}

	int yen = INF;

	rep(p, 1 << n) {
		int cost = 0;
		vector<int> v(m);
		rep(i, n) {
			if ( p >> i & 1 ) {
				cost += c[i];
				rep(j, m) v[j] += a[i][j];
			}
		}
		bool ok = true;
		rep(i, m) ok &= v[i] >= x;
		if (ok) yen = min(yen, cost);
	}
	if (yen == INF) cout << -1 << endl;
	else cout << yen << endl;
	// 	return 0;
	// }
	return 0;
}