import std.stdio;
import std.algorithm;
import std.math;
import std.conv;
import std.string;

T readNum(T)(){
  return readStr.to!T;
}

T[] readNums(T)(){
  return readStr.split.to!(T[]);
}

string readStr(){
  return readln.chomp;
}

void main(){
  auto nmx = readNums!int;
  auto ca = new int[][](nmx[0], nmx[1]+1);

  foreach(i; 0 .. nmx[0]){
    ca[i] = readNums!int;
  }

  int ret = -1;

  foreach(i; 0.. 2^^nmx[0]){
    int[] t = new int[](nmx[1]+1);
    foreach(j; 0 .. nmx[0]){
      if(i & (1<<j)){
        t[] += ca[j][];
      }

      bool ok = true;
      foreach(e; t[1 .. $]){
        if(e < nmx[2]){
          ok = false;
          break;
        }
      }

      if(ok && (ret == -1 || t[0] < ret)){
        ret = t[0];
      }
    }
  }

  writeln(ret);
}
