local mmi, mma = math.min, math.max
local bls, brs = bit.lshift, bit.rshift
local n, m, x = io.read("*n", "*n", "*n")
local c = {}
local a = {}
for i = 1, n do
  c[i] = io.read("*n")
  a[i] = {}
  for j = 1, m do
    a[i][j] = io.read("*n")
  end
end
local ret = -1
local tot = bls(1, n)
for it = 0, tot - 1 do
  local ti = it
  local cost = 0
  local z = {}
  for j = 1, m do
    z[j] = 0
  end
  for j = 1, n do
    if ti % 2 == 1 then
      for k = 1, m do
        z[k] = z[k] + a[j][k]
      end
      cost = cost + c[j]
    end
    ti = brs(ti, 1)
  end
  local valid = true
  for j = 1, m do
    if z[j] < x then
      valid = false
    end
  end
  if valid then
    if ret == -1 then
      ret = cost
    else
      ret = mmi(ret, cost)
    end
  end
end
print(ret)
