// import scala.io.StdIn._
import java.util.Scanner

object Main extends App {
  def readALine(c:Int):List[Int] = if (c > 0) sc.nextInt::readALine(c-1) else Nil
  def readLines(r:Int, c:Int):List[List[Int]] = if (r > 0) readALine(c)::readLines(r-1, c) else Nil
  val sc = new Scanner(System.in)
  val n, m, x = sc.nextInt
  val ls = readLines(n, m+1)
//  println(ls)

  def opVecs(op:(Int, Int)=>Int,a:List[Int],b:List[Int],ac:List[Int]):List[Int] = {
    (a, b) match {
      case (Nil, Nil) => ac.reverse
      case (x::xs, y::ys) => opVecs(op, xs, ys, op(x,y)::ac)
    }
  }
  def add(a:List[Int],b:List[Int]):List[Int] = opVecs((x,y)=>x+y, a, b, Nil)

  def haveAchieved(v:List[Int],x:Int):Boolean = v.forall((a) => a>=x)

  def evaluate(books:List[List[Int]], cost:Int, grades:List[Int], minCost:Int):Int = {
    books match {
      case Nil => if (haveAchieved(grades, x))
                    if (cost < minCost) cost else minCost
                  else minCost
      case (c::el)::xs if (c + cost <  minCost) => {
        val newMinCost = evaluate(xs, c+cost, add(el, grades), minCost)
        evaluate(books.tail, cost, grades, newMinCost)
      }
      case _ => evaluate(books.tail,cost,grades,minCost)
    }

  }

  val bound = 12*100000+1
  val result = evaluate(ls, 0, List.fill(m)(0), bound)
  println(if (result < bound) result else -1)  
}
