#!/usr/bin/python3

# -*- coding: utf-8 -*-

import numpy as np

def func(ans, b_list, a_list, c_list, k, x):

    if k == 0:

        b_list = np.asarray(b_list)

        x_list = np.dot(b_list, a_list)

        if np.all(x_list >= x):

            return np.inner(c_list, b_list)

        else:

            return ans

    ans = min(ans, func(ans, b_list + [1], a_list, c_list, k - 1, x))

    ans = min(ans, func(ans, b_list + [0], a_list, c_list, k - 1, x))

    return ans



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

c_list = [] 

a_list = []

for i in range(0, n):

    c, *a = list(map(int, input().split()))

    c_list.append(c)

    a_list.append(a)

ans = float("inf")

c_list = np.asarray(c_list)

a_list = np.asarray(a_list)

ans = min(ans, func(ans, [1], a_list, c_list, n - 1, x))

ans = min(ans, func(ans, [0], a_list, c_list, n - 1, x))



if ans == float("inf"):

    print((-1))

else:

    print(ans)

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

c_list = [] 

a_list = []

for i in range(0, n):

  c, *a = list(map(int, input().split()))

  c_list.append(c)

  a_list.append(a)

ans = float("inf")



for x1 in [0, 1]:

  for x2 in [0, 1]:

    for x3 in [0, 1]:

      for x4 in [0, 1]:

        for x5 in [0, 1]:

          for x6 in [0, 1]:

            for x7 in [0, 1]:

              for x8 in [0, 1]:

                for x9 in [0, 1]:

                  for x10 in [0, 1]:

                    for x11 in [0, 1]:

                      for x12 in [0, 1]:

                        if n == 1:

                          x_list = [x1]

                        elif n == 2:

                          x_list = [x1, x2]

                        elif n == 3:

                          x_list = [x1, x2, x3]

                        elif n == 4:

                          x_list = [x1, x2, x3, x4]

                        elif n == 5:

                          x_list = [x1, x2, x3, x4 ,x5]

                        elif n == 6:

                          x_list = [x1, x2, x3, x4 ,x5, x6]

                        elif n == 7:

                          x_list = [x1, x2, x3, x4 ,x5, x6, x7]

                        elif n == 8:

                          x_list = [x1, x2, x3, x4 ,x5, x6, x7, x8]

                        elif n == 9:

                          x_list = [x1, x2, x3, x4 ,x5, x6, x7, x8, x9]

                        elif n == 10:

                          x_list = [x1, x2, x3, x4 ,x5, x6, x7, x8, x9, x10]

                        elif n == 11:

                          x_list = [x1, x2, x3, x4 ,x5, x6, x7, x8, x9, x10, x11]

                        elif n == 12:

                          x_list = [x1, x2, x3, x4 ,x5, x6, x7, x8, x9, x10, x11, x12]

                        cost = 0

                        gaku_list = [0] * m

                        for i in range(0, n):

                          if x_list[i] == 1:

                            for j in range(0, m):

                              gaku_list[j] += a_list[i][j]

                            cost += c_list[i]

                        flag = 1

                        for gaku in gaku_list:

                          if gaku < x:

                            flag = 0

                            break

                        if flag == 1 and cost < ans:

                          ans = cost

if ans == float("inf"):

  print((-1))

else:

  print(ans)
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import numpy as np


def func(ans, b_list, a_list, c_list, k, x):
    if k == 0:
        b_list = np.asarray(b_list)
        x_list = np.dot(b_list, a_list)
        if np.all(x_list >= x):
            return np.inner(c_list, b_list)
        else:
            return ans
    ans = min(ans, func(ans, b_list + [1], a_list, c_list, k - 1, x))
    ans = min(ans, func(ans, b_list + [0], a_list, c_list, k - 1, x))
    return ans


n, m, x = list(map(int, input().split()))
c_list = []
a_list = []
for i in range(0, n):
    c, *a = list(map(int, input().split()))
    c_list.append(c)
    a_list.append(a)
ans = float("inf")
c_list = np.asarray(c_list)
a_list = np.asarray(a_list)
ans = min(ans, func(ans, [1], a_list, c_list, n - 1, x))
ans = min(ans, func(ans, [0], a_list, c_list, n - 1, x))
if ans == float("inf"):
    print((-1))
else:
    print(ans)

n, m, x = list(map(int, input().split()))
c_list = []
a_list = []
for i in range(0, n):
    c, *a = list(map(int, input().split()))
    c_list.append(c)
    a_list.append(a)
ans = float("inf")
for x1 in [0, 1]:
    for x2 in [0, 1]:
        for x3 in [0, 1]:
            for x4 in [0, 1]:
                for x5 in [0, 1]:
                    for x6 in [0, 1]:
                        for x7 in [0, 1]:
                            for x8 in [0, 1]:
                                for x9 in [0, 1]:
                                    for x10 in [0, 1]:
                                        for x11 in [0, 1]:
                                            for x12 in [0, 1]:
                                                if n == 1:
                                                    x_list = [x1]
                                                elif n == 2:
                                                    x_list = [x1, x2]
                                                elif n == 3:
                                                    x_list = [x1, x2, x3]
                                                elif n == 4:
                                                    x_list = [x1, x2, x3, x4]
                                                elif n == 5:
                                                    x_list = [x1, x2, x3, x4, x5]
                                                elif n == 6:
                                                    x_list = [x1, x2, x3, x4, x5, x6]
                                                elif n == 7:
                                                    x_list = [
                                                        x1,
                                                        x2,
                                                        x3,
                                                        x4,
                                                        x5,
                                                        x6,
                                                        x7,
                                                    ]
                                                elif n == 8:
                                                    x_list = [
                                                        x1,
                                                        x2,
                                                        x3,
                                                        x4,
                                                        x5,
                                                        x6,
                                                        x7,
                                                        x8,
                                                    ]
                                                elif n == 9:
                                                    x_list = [
                                                        x1,
                                                        x2,
                                                        x3,
                                                        x4,
                                                        x5,
                                                        x6,
                                                        x7,
                                                        x8,
                                                        x9,
                                                    ]
                                                elif n == 10:
                                                    x_list = [
                                                        x1,
                                                        x2,
                                                        x3,
                                                        x4,
                                                        x5,
                                                        x6,
                                                        x7,
                                                        x8,
                                                        x9,
                                                        x10,
                                                    ]
                                                elif n == 11:
                                                    x_list = [
                                                        x1,
                                                        x2,
                                                        x3,
                                                        x4,
                                                        x5,
                                                        x6,
                                                        x7,
                                                        x8,
                                                        x9,
                                                        x10,
                                                        x11,
                                                    ]
                                                elif n == 12:
                                                    x_list = [
                                                        x1,
                                                        x2,
                                                        x3,
                                                        x4,
                                                        x5,
                                                        x6,
                                                        x7,
                                                        x8,
                                                        x9,
                                                        x10,
                                                        x11,
                                                        x12,
                                                    ]
                                                cost = 0
                                                gaku_list = [0] * m
                                                for i in range(0, n):
                                                    if x_list[i] == 1:
                                                        for j in range(0, m):
                                                            gaku_list[j] += a_list[i][j]
                                                        cost += c_list[i]
                                                flag = 1
                                                for gaku in gaku_list:
                                                    if gaku < x:
                                                        flag = 0
                                                        break
                                                if flag == 1 and cost < ans:
                                                    ans = cost
if ans == float("inf"):
    print((-1))
else:
    print(ans)

-#!/usr/bin/python3 -# -*- coding: utf-8 -*- -import numpy as np - - -def func(ans, b_list, a_list, c_list, k, x): -    if k == 0: -        b_list = np.asarray(b_list) -        x_list = np.dot(b_list, a_list) -        if np.all(x_list >= x): -            return np.inner(c_list, b_list) -        else: -            return ans -    ans = min(ans, func(ans, b_list + [1], a_list, c_list, k - 1, x)) -    ans = min(ans, func(ans, b_list + [0], a_list, c_list, k - 1, x)) -    return ans - - -c_list = np.asarray(c_list) -a_list = np.asarray(a_list) -ans = min(ans, func(ans, [1], a_list, c_list, n - 1, x)) -ans = min(ans, func(ans, [0], a_list, c_list, n - 1, x)) +for x1 in [0, 1]: +    for x2 in [0, 1]: +        for x3 in [0, 1]: +            for x4 in [0, 1]: +                for x5 in [0, 1]: +                    for x6 in [0, 1]: +                        for x7 in [0, 1]: +                            for x8 in [0, 1]: +                                for x9 in [0, 1]: +                                    for x10 in [0, 1]: +                                        for x11 in [0, 1]: +                                            for x12 in [0, 1]: +                                                if n == 1: +                                                    x_list = [x1] +                                                elif n == 2: +                                                    x_list = [x1, x2] +                                                elif n == 3: +                                                    x_list = [x1, x2, x3] +                                                elif n == 4: +                                                    x_list = [x1, x2, x3, x4] +                                                elif n == 5: +                                                    x_list = [x1, x2, x3, x4, x5] +                                                elif n == 6: +                                                    x_list = [x1, x2, x3, x4, x5, x6] +                                                elif n == 7: +                                                    x_list = [ +                                                        x1, +                                                        x2, +                                                        x3, +                                                        x4, +                                                        x5, +                                                        x6, +                                                        x7, +                                                    ] +                                                elif n == 8: +                                                    x_list = [ +                                                        x1, +                                                        x2, +                                                        x3, +                                                        x4, +                                                        x5, +                                                        x6, +                                                        x7, +                                                        x8, +                                                    ] +                                                elif n == 9: +                                                    x_list = [ +                                                        x1, +                                                        x2, +                                                        x3, +                                                        x4, +                                                        x5, +                                                        x6, +                                                        x7, +                                                        x8, +                                                        x9, +                                                    ] +                                                elif n == 10: +                                                    x_list = [ +                                                        x1, +                                                        x2, +                                                        x3, +                                                        x4, +                                                        x5, +                                                        x6, +                                                        x7, +                                                        x8, +                                                        x9, +                                                        x10, +                                                    ] +                                                elif n == 11: +                                                    x_list = [ +                                                        x1, +                                                        x2, +                                                        x3, +                                                        x4, +                                                        x5, +                                                        x6, +                                                        x7, +                                                        x8, +                                                        x9, +                                                        x10, +                                                        x11, +                                                    ] +                                                elif n == 12: +                                                    x_list = [ +                                                        x1, +                                                        x2, +                                                        x3, +                                                        x4, +                                                        x5, +                                                        x6, +                                                        x7, +                                                        x8, +                                                        x9, +                                                        x10, +                                                        x11, +                                                        x12, +                                                    ] +                                                cost = 0 +                                                gaku_list = [0] * m +                                                for i in range(0, n): +                                                    if x_list[i] == 1: +                                                        for j in range(0, m): +                                                            gaku_list[j] += a_list[i][j] +                                                        cost += c_list[i] +                                                flag = 1 +                                                for gaku in gaku_list: +                                                    if gaku < x: +                                                        flag = 0 +                                                        break +                                                if flag == 1 and cost < ans: +                                                    ans = cost