inputLine=input()
N=int(inputLine.split(" ")[0])
M=int(inputLine.split(" ")[1])
X=int(inputLine.split(" ")[2])

CandA=[]
for i in range(N):
    inputLine=input()
    CandA.append(inputLine.split(" "))

for i in range(len(CandA)):
    for j in range(len(CandA[i])):
        CandA[i][j] = int(CandA[i][j])

algorithmLevel = []
for i in range(M):
    algorithmLevel.append(0)

result = -1

for a1 in range(2):    
    for a2 in range(2):
        for a3 in range(2):
            for a4 in range(2):
                for a5 in range(2):
                    for a6 in range(2):
                        for a7 in range(2):
                            for a8 in range(2):
                                for a9 in range(2):
                                    for a10 in range(2):
                                        for a11 in range(2):
                                            for a12 in range(2):
                                                
                                                for i in range(M):
                                                    algorithmLevel[i] = 0

                                                for i in range(1, N+1):
                                                    for j in range(1, M+1):
                                                        if i == 1:
                                                            algorithmLevel[j-1] += CandA[i-1][j] * a1

                                                        if i == 2:
                                                            algorithmLevel[j-1] += CandA[i-1][j] * a2

                                                        if i == 3:
                                                            algorithmLevel[j-1] += CandA[i-1][j] * a3

                                                        if i == 4:
                                                            algorithmLevel[j-1] += CandA[i-1][j] * a4

                                                        if i == 5:
                                                            algorithmLevel[j-1] += CandA[i-1][j] * a5

                                                        if i == 6:
                                                            algorithmLevel[j-1] += CandA[i-1][j] * a6

                                                        if i == 7:
                                                            algorithmLevel[j-1] += CandA[i-1][j] * a7

                                                        if i == 8:
                                                            algorithmLevel[j-1] += CandA[i-1][j] * a8

                                                        if i == 9:
                                                            algorithmLevel[j-1] += CandA[i-1][j] * a9

                                                        if i == 10:
                                                            algorithmLevel[j-1] += CandA[i-1][j] * a10

                                                        if i == 11:
                                                            algorithmLevel[j-1] += CandA[i-1][j] * a11

                                                        if i == 12:
                                                            algorithmLevel[j-1] += CandA[i-1][j] * a12
                                                
                                                levelCheck = True
                                                for i in range(len(algorithmLevel)):
                                                    if algorithmLevel[i] < X:
                                                        levelCheck = False
                                                if levelCheck == True:
                                                    sumBooksPrice = 0
                                                    for i in range(1, N+1):
                                                        if i == 1:
                                                            sumBooksPrice += CandA[i-1][0] * a1

                                                        if i == 2:
                                                            sumBooksPrice += CandA[i-1][0] * a2

                                                        if i == 3:
                                                           sumBooksPrice += CandA[i-1][0] * a3

                                                        if i == 4:
                                                           sumBooksPrice += CandA[i-1][0] * a4

                                                        if i == 5:
                                                           sumBooksPrice += CandA[i-1][0] * a5

                                                        if i == 6:
                                                           sumBooksPrice += CandA[i-1][0] * a6

                                                        if i == 7:
                                                           sumBooksPrice += CandA[i-1][0] * a7

                                                        if i == 8:
                                                           sumBooksPrice += CandA[i-1][0] * a8

                                                        if i == 9:
                                                           sumBooksPrice += CandA[i-1][0] * a9

                                                        if i == 10:
                                                           sumBooksPrice += CandA[i-1][0] * a10

                                                        if i == 11:
                                                           sumBooksPrice += CandA[i-1][0] * a11

                                                        if i == 12:
                                                           sumBooksPrice += CandA[i-1][0] * a12

                                                    if result == -1:
                                                        result = sumBooksPrice                                                        
                                                    else:
                                                        if result > sumBooksPrice:
                                                            result = sumBooksPrice

print(result)
                                                


                                                    























Measured memory_bytes: 9252