local read = io.read
local min = math.min

local n, m, x = read("n", "n", "n")
local c_t, a_t = {}, {}
for i = 1, n do
	c_t[i] = read("n")
	a_t[i] = {}
	for j = 1, m do
		a_t[i][j] = read("n")
	end
end

local money_min = math.maxinteger
for i = 0, 2^n - 1 do
	local money = 0
	local score_t = {}
	for j = 1, m do
		score_t[j] = 0
	end

	for j = 0, n - 1 do
		local bit = i >> j
		if bit == 0 then
			break
		end
		if bit & 1 == 1 then
			money = money + c_t[j + 1]
			for k = 1, m do
				score_t[k] = score_t[k] + a_t[j + 1][k]
			end
		end
	end

	local score_min = math.maxinteger
	for j = 1, m do
		score_min = min(score_min, score_t[j])
	end
	if score_min >= x then
		money_min = min(money_min, money)
	end
end

print((money_min == math.maxinteger) and -1 or money_min)
