import java.util.Scanner

import scala.io.StdIn._
object Main extends App {

  val Array(n,m,x) = scala.io.StdIn.readLine().split(" ").map(_.toInt)
  val bookCostAndSkills = Array.fill(n)(scala.io.StdIn.readLine().split(" ").map(_.toInt))
  val bookCosts = bookCostAndSkills.map(_.head)
  val bookSkills = bookCostAndSkills.map(_.drop(1))

  def solve() = {
    var ans = Long.MaxValue
    for(i <- 0 until 1 << n) {
      var cost = 0
      val skillArr = Array.fill(m)(0)
      for(j <- 0 until n) {
        if(isBitOn(i, j)) {
          cost += bookCosts(j)
          for(k <- 0 until m) skillArr(k) += bookSkills(j)(k)
        }
      }
      if(skillArr.forall(_ >= x)) ans = Math.min(ans, cost)
    }

    if(ans == Long.MaxValue) -1L else ans
  }

  def isBitOn(num: Int, digit: Int): Boolean =
    (num & (1 << digit)) != 0

  println(solve())

}

