#include <stdbool.h>
#include <stdio.h>
int main() {
	int n, m, x, c[12], a[12][12] = {0};
	int cost = 1e9;
	scanf("%d%d%d", &n, &m, &x);
	for (int i = 0; i < n; i++) {
		scanf("%d", &c[i]);
		for (int j = 0; j < m; j++) {
			scanf("%d", &a[i][j]);
		}
	}
	for (int bit = 0; bit < (1 << n); bit++) {
		int u[12] = {0};
		int co = 0;
		for (int i = 0; i < n; i++) {
			if ((bit >> i) & 1) {
				co += c[i];
				for (int j = 0; j < m; j++) {
					u[j] += a[i][j];
				}
			}
		}
		bool isOK = true;
		for (int i = 0; i < n; i++) {
			if (u[i] < x) {
				isOK = false;
				// break;
			}
		}
		// if (isOK)
		if (isOK && cost > co) {
			cost = co;
		}
	}
	printf("%d\n", cost == (int)1e9 ? -1 : cost);
	return 0;
}