from statistics import median

#import collections

#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]

from fractions import gcd

from itertools import combinations # (string,3) 3回

from collections import deque

from collections import defaultdict

import bisect

#

#    d = m - k[i] - k[j]

#    if kk[bisect.bisect_right(kk,d) - 1] == d:

#

#

#

# pythonで無理なときは、pypyでやると正解するかも！！

#

#



import sys

sys.setrecursionlimit(10000000)

mod = 10**9 + 7



def readInts():

  return list(map(int,input().split()))

def main():

    n,m,x = readInts()

    ans = float('inf')

    money = []

    rikai = []

    for i in range(n):

        LIST = readInts()

        money.append(LIST[0])

        rikai.append(LIST[1:])

    #print(money,rikai)

    # bit 全探索

    for bit in range(1 << n):

        mo = 0

        ansrikai = [0] * m

        for i in range(n):

            if bit & (1 << i):

                mo += money[i]

                for j in range(m):

                    ansrikai[j] += rikai[i][j]

        ok = True

        #print(ansrikai)

        for j in range(m):

            if ansrikai[j] >= x:

                ok = True

            else:

                ok = False

                break

        if ok:

            #print(ansrikai)

            ans = min(ans,mo)

    print((ans if ans != float('inf') else -1))

if __name__ == '__main__':

  main()

#from statistics import median

#import collections

#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]

from fractions import gcd

from itertools import combinations,permutations,accumulate, product # (string,3) 3回

#from collections import deque

from collections import deque,defaultdict,Counter

import decimal

import re

#import bisect

#

#    d = m - k[i] - k[j]

#    if kk[bisect.bisect_right(kk,d) - 1] == d:

#

#

#

# pythonで無理なときは、pypyでやると正解するかも！！

#

#

# my_round_int = lambda x:np.round((x*2 + 1)//2)

# 四捨五入g

import sys

sys.setrecursionlimit(10000000)

mod = 10**9 + 7

#mod = 9982443453

def readInts():

  return list(map(int,input().split()))

def I():

  return int(eval(input()))

n,m,x = readInts()

C = [readInts() for _ in range(n)]

INF = float('inf')

ans = INF

for bit in range(1 << n):

    all = [0] * m

    money = 0

    for i in range(n):

        if bit & (1 << i):

            money += C[i][0]

            for j in range(m):

                all[j] += C[i][j+1]

    flag = True

    for k in range(m):

        if all[k] >= x:

            pass

        else:

            flag = False

            break

    if flag:

        ans = min(ans, money)

print((ans if ans != INF else '-1'))

from statistics import median

# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations  # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect

#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
import sys

sys.setrecursionlimit(10000000)
mod = 10**9 + 7


def readInts():
    return list(map(int, input().split()))


def main():
    n, m, x = readInts()
    ans = float("inf")
    money = []
    rikai = []
    for i in range(n):
        LIST = readInts()
        money.append(LIST[0])
        rikai.append(LIST[1:])
    # print(money,rikai)
    # bit 全探索
    for bit in range(1 << n):
        mo = 0
        ansrikai = [0] * m
        for i in range(n):
            if bit & (1 << i):
                mo += money[i]
                for j in range(m):
                    ansrikai[j] += rikai[i][j]
        ok = True
        # print(ansrikai)
        for j in range(m):
            if ansrikai[j] >= x:
                ok = True
            else:
                ok = False
                break
        if ok:
            # print(ansrikai)
            ans = min(ans, mo)
    print((ans if ans != float("inf") else -1))


if __name__ == "__main__":
    main()

# from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations, permutations, accumulate, product  # (string,3) 3回

# from collections import deque
from collections import deque, defaultdict, Counter
import decimal
import re

# import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
import sys

sys.setrecursionlimit(10000000)
mod = 10**9 + 7
# mod = 9982443453
def readInts():
    return list(map(int, input().split()))


def I():
    return int(eval(input()))


n, m, x = readInts()
C = [readInts() for _ in range(n)]
INF = float("inf")
ans = INF
for bit in range(1 << n):
    all = [0] * m
    money = 0
    for i in range(n):
        if bit & (1 << i):
            money += C[i][0]
            for j in range(m):
                all[j] += C[i][j + 1]
    flag = True
    for k in range(m):
        if all[k] >= x:
            pass
        else:
            flag = False
            break
    if flag:
        ans = min(ans, money)
print((ans if ans != INF else "-1"))

-from statistics import median - +# from statistics import median -from itertools import combinations  # (string,3) 3回 -from collections import deque -from collections import defaultdict -import bisect +from itertools import combinations, permutations, accumulate, product  # (string,3) 3回 +# from collections import deque +from collections import deque, defaultdict, Counter +import decimal +import re + +# import bisect +# my_round_int = lambda x:np.round((x*2 + 1)//2) +# 四捨五入g - - +# mod = 9982443453 -def main(): -    n, m, x = readInts() -    ans = float("inf") -    money = [] -    rikai = [] -    for i in range(n): -        LIST = readInts() -        money.append(LIST[0]) -        rikai.append(LIST[1:]) -    # print(money,rikai) -    # bit 全探索 -    for bit in range(1 << n): -        mo = 0 -        ansrikai = [0] * m -        for i in range(n): -            if bit & (1 << i): -                mo += money[i] -                for j in range(m): -                    ansrikai[j] += rikai[i][j] -        ok = True -        # print(ansrikai) -        for j in range(m): -            if ansrikai[j] >= x: -                ok = True -            else: -                ok = False -                break -        if ok: -            # print(ansrikai) -            ans = min(ans, mo) -    print((ans if ans != float("inf") else -1)) +def I(): +    return int(eval(input())) -if __name__ == "__main__": -    main() +n, m, x = readInts() +C = [readInts() for _ in range(n)] +INF = float("inf") +ans = INF +for bit in range(1 << n): +    all = [0] * m +    money = 0 +    for i in range(n): +        if bit & (1 << i): +            money += C[i][0] +            for j in range(m): +                all[j] += C[i][j + 1] +    flag = True +    for k in range(m): +        if all[k] >= x: +            pass +        else: +            flag = False +            break +    if flag: +        ans = min(ans, money) +print((ans if ans != INF else "-1"))