#include<bits/stdc++.h>
using namespace std;
#define loop(i,x,z) for (int i=x;i<z;i++)
int n, m, x, A[15][15], dp[5000][15], p[15], k = 1, price[5000], ans = INT_MAX;
int main()
{
	cin >> n >> m >> x;
	loop(i, 1, n + 1)
	{
		cin >> p[i];
		loop(j, 1, m + 1)
			cin >> A[i][j];
	}
	k = k << 12;
	loop(i, 0, k)
	{
		loop(j, 1, n + 1)
		{
			int l = 1 << (j - 1);
			if (i & l)
			{
				price[i] += p[j];
				loop(z, 1, m + 1)dp[i][z] += A[j][z];
			}
		}
	}
	loop(i, 1, k)
	{
		bool flag = 1;
		loop(j, 1, m + 1) if (dp[i][j] < x)flag = 0;
		if (flag)
		{
			ans = min(ans, price[i]);
		}
	}
	if (ans == INT_MAX)cout << -1;
	else cout << ans;
}