#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include <math.h>
#include <stdbool.h>


//using ll = long long;
int ASC( void *a,  void *b) {
	return strcmp(*(const char **)a, *(const char **)b);//降順
}
int GCD(int a, int b) {	//最大公約数
	if (b == 0) return a;
	else return GCD(b, a % b);
}
int min(int a, int b ) {
	if (a < b) {
		return a;
	}
	else
		return b;
}
int max(int a, int b) {
	if (a < b)
		return b;
	else
		return a;
}

long a[200000];
int main(void)
{
	int n, m, x, money = 2147483647, keep = 0;
	int c[13][13], rikaido[13];
	scanf("%d%d%d",&n,&m,&x);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j <= m; j++) {
			scanf("%d",&c[i][j]);
			rikaido[i] = 0;
		}
	}
	for (int bit = 0; bit < (1 << n); bit++) {
		for (int i = 0; i < n; i++) {
			if (bit&(1 << i)) {

				//printf("%d ", c[i][0]);
				keep += c[i][0];

				for (int h = 1; h <= m ; h++) {
					rikaido[h] += c[i][h];
				}
			}
		}
		bool flag = 0;
		for (int l = 1; l <= m; l++) {
			if (rikaido[l] < x) {
				flag = 1;
				rikaido[l] = 0;
				break;
			}
			rikaido[l] = 0;
		}
		if (flag == 0) {
			money = min(keep, money);
			//printf("●");
		}
		keep = 0;
		//printf("\n");
	}
	if (money == 2147483647)
		printf("-1");
	else
		printf("%d", money);


	return 0;
}