n, m, x = list(map(int, input().split()))

info= [list(map(int, input().split())) for i in range(n)]



ans = 10 ** 18

for bit_state in range(1 << n):

    tmp = [0] * m

    cost = 0

    for i in range(n):

        if bit_state & (1 << i):

            for j in range(m):

                tmp[j] += info[i][j + 1]

            cost += info[i][0]

    flag = True

    for j in range(m):

        if tmp[j] < x:

            flag = False

    if flag:

        ans = min(cost, ans)

        

        

if ans == 10 ** 18:

    print((-1))

else:

    print(ans)



n, m, x = list(map(int, input().split()))

info = [list(map(int, input().split())) for i in range(n)]



ans = 10 ** 18

for bit_state in range(1 << n):

    tmp = [0] * m

    cost = 0

    for i in range(n):

        if bit_state & (1 << i):

            for j in range(m):

                tmp[j] += info[i][j + 1]

            cost += info[i][0]



    for j in range(m):

        if tmp[j] < x:

            break

    else:

        ans = min(cost, ans)



if ans == 10 ** 18:

    print((-1))

else:

    print(ans)
n, m, x = list(map(int, input().split()))
info = [list(map(int, input().split())) for i in range(n)]
ans = 10**18
for bit_state in range(1 << n):
    tmp = [0] * m
    cost = 0
    for i in range(n):
        if bit_state & (1 << i):
            for j in range(m):
                tmp[j] += info[i][j + 1]
            cost += info[i][0]
    flag = True
    for j in range(m):
        if tmp[j] < x:
            flag = False
    if flag:
        ans = min(cost, ans)
if ans == 10**18:
    print((-1))
else:
    print(ans)

n, m, x = list(map(int, input().split()))
info = [list(map(int, input().split())) for i in range(n)]
ans = 10**18
for bit_state in range(1 << n):
    tmp = [0] * m
    cost = 0
    for i in range(n):
        if bit_state & (1 << i):
            for j in range(m):
                tmp[j] += info[i][j + 1]
            cost += info[i][0]
    for j in range(m):
        if tmp[j] < x:
            break
    else:
        ans = min(cost, ans)
if ans == 10**18:
    print((-1))
else:
    print(ans)

-    flag = True -            flag = False -    if flag: +            break +    else: