from sys import stdin

import math

import fractions

from collections import deque

from collections import Counter

import itertools



INF = 10 ** 10



N, M, X  = [int(x) for x in stdin.readline().rstrip().split()]



CA = [list(map(int, stdin.readline().rstrip().split())) for _ in range(N)]



knowledge_list = [[0 for _ in range(M)]]

money_list = [0]



for i in range(N):

    C = CA[i][0]

    A = CA[i][1:]



    # 購入する場合

    tmp2 = []

    for i, knowledge in enumerate(knowledge_list):

        tmp = []

        for k in range(len(knowledge)):

            tmp.append(knowledge[k] + A[k])

        

        tmp2.append(tmp)

        money_list.append(money_list[i]+C)



    knowledge_list = knowledge_list + tmp2



ans = INF

for i in range(len(money_list)):

    if min(knowledge_list[i]) >= X:

        ans = min(ans, money_list[i])



if ans != INF:

    print(ans)

else:

    print((-1))





            

from sys import stdin

import math

import fractions

from collections import deque

from collections import Counter

import itertools



INF = 10 ** 10



N, M, X  = [int(x) for x in stdin.readline().rstrip().split()]



CA = [list(map(int, stdin.readline().rstrip().split())) for _ in range(N)]



dp = [[[0 for _ in range(M)] for _ in range(4)] for _ in range(N+1)]

dp_money = [[0 for _ in range(2)] for _ in range(N+1)]



tm = [0 for _ in range(2**N)] 

tl = [[0 for _ in range(M)] for _ in range(2**N)]



knowledge_list = [[0 for _ in range(M)]]

money_list = [0]



for i in range(N):

    C = CA[i][0]

    A = CA[i][1:]



    # 購入する場合

    tmp2 = []

    

    for i, knowledge in enumerate(knowledge_list):

        tmp = []

        for k in range(len(knowledge)):

            tmp.append(knowledge[k] + A[k])

        

        tmp2.append(tmp)

        money_list.append(money_list[i]+C)



    knowledge_list = knowledge_list + tmp2



ans = INF

for i in range(len(money_list)):

    if min(knowledge_list[i]) >= X:

        ans = min(ans, money_list[i])



if ans != INF:

    print(ans)

else:

    print((-1))





            

from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10**10
N, M, X = [int(x) for x in stdin.readline().rstrip().split()]
CA = [list(map(int, stdin.readline().rstrip().split())) for _ in range(N)]
knowledge_list = [[0 for _ in range(M)]]
money_list = [0]
for i in range(N):
    C = CA[i][0]
    A = CA[i][1:]
    # 購入する場合
    tmp2 = []
    for i, knowledge in enumerate(knowledge_list):
        tmp = []
        for k in range(len(knowledge)):
            tmp.append(knowledge[k] + A[k])
        tmp2.append(tmp)
        money_list.append(money_list[i] + C)
    knowledge_list = knowledge_list + tmp2
ans = INF
for i in range(len(money_list)):
    if min(knowledge_list[i]) >= X:
        ans = min(ans, money_list[i])
if ans != INF:
    print(ans)
else:
    print((-1))

from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10**10
N, M, X = [int(x) for x in stdin.readline().rstrip().split()]
CA = [list(map(int, stdin.readline().rstrip().split())) for _ in range(N)]
dp = [[[0 for _ in range(M)] for _ in range(4)] for _ in range(N + 1)]
dp_money = [[0 for _ in range(2)] for _ in range(N + 1)]
tm = [0 for _ in range(2**N)]
tl = [[0 for _ in range(M)] for _ in range(2**N)]
knowledge_list = [[0 for _ in range(M)]]
money_list = [0]
for i in range(N):
    C = CA[i][0]
    A = CA[i][1:]
    # 購入する場合
    tmp2 = []
    for i, knowledge in enumerate(knowledge_list):
        tmp = []
        for k in range(len(knowledge)):
            tmp.append(knowledge[k] + A[k])
        tmp2.append(tmp)
        money_list.append(money_list[i] + C)
    knowledge_list = knowledge_list + tmp2
ans = INF
for i in range(len(money_list)):
    if min(knowledge_list[i]) >= X:
        ans = min(ans, money_list[i])
if ans != INF:
    print(ans)
else:
    print((-1))

+dp = [[[0 for _ in range(M)] for _ in range(4)] for _ in range(N + 1)] +dp_money = [[0 for _ in range(2)] for _ in range(N + 1)] +tm = [0 for _ in range(2**N)] +tl = [[0 for _ in range(M)] for _ in range(2**N)]