

void main(){
	
	auto NMX = readLine!size_t();
	
	size_t minCost = size_t.max;
	size_t cost;
	
	size_t[][] bookList;
	
	foreach( n ; 0..NMX[0] ){
		bookList ~= readLine!size_t();
	}
	
	size_t[] skillList;
	
	
	foreach( i ; 0..(2.pow(NMX[0])) ){
		skillList = new size_t[](NMX[1]);
		cost = 0;
		
		foreach( size_t j ; 0..NMX[0] ){
			if (  ((i>>j)%2) == 1 ){continue;}
			
			skillList[0..$] += bookList[j][1..$];
			cost += bookList[j][0];
		}
		// skill is enough
		if ( skillList.minElement() >= NMX[2] ){
			if( cost < minCost ){
				minCost = cost;
			}
			//writeln("OK:",skillList,":cost",cost);
		} else {
			//writeln("NG:",skillList,":cost",cost);
		}
	}
	
	if( minCost == size_t.max ){
		writeln(-1);
	} else {
		minCost.writeln();
	}
	
	
	return;
}



import std;


string readStr(){
	return readln().chomp();
}
T[] readLine( T = long )(){
	return readln().split().to!(T[])();
}
