def resolve():

    import itertools

    impossible = 10 ** 20

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

    ans = impossible

    books = [None] * n

    for i in range(n):

        books[i] = list(map(int, input().split()))

    for i in list(itertools.product([True, False], repeat=n)):

        u = [0] * m

        yen = 0

        for index, j in enumerate(i):

            if not j:

                continue

            yen += books[index][0]

            for k in range(m):

                u[k] += books[index][k + 1]

        for j in u:

            if j < x:

                break

        else:

            ans = min(yen, ans)

    print((ans if ans < impossible else -1))





if __name__ == '__main__':

    resolve()

def resolve():

    import itertools

    impossible = 10 ** 20

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

    ans = impossible

    books = [None] * n

    for i in range(n):

        books[i] = list(map(int, input().split()))

    for i in itertools.product([True, False], repeat=n):

        u = [0] * m

        yen = 0

        for index, j in enumerate(i):

            if not j:

                continue

            yen += books[index][0]

            for k in range(m):

                u[k] += books[index][k + 1]

        for j in u:

            if j < x:

                break

        else:

            ans = min(yen, ans)

    print((ans if ans < impossible else -1))





if __name__ == '__main__':

    resolve()

def resolve():
    import itertools

    impossible = 10**20
    n, m, x = list(map(int, input().split()))
    ans = impossible
    books = [None] * n
    for i in range(n):
        books[i] = list(map(int, input().split()))
    for i in list(itertools.product([True, False], repeat=n)):
        u = [0] * m
        yen = 0
        for index, j in enumerate(i):
            if not j:
                continue
            yen += books[index][0]
            for k in range(m):
                u[k] += books[index][k + 1]
        for j in u:
            if j < x:
                break
        else:
            ans = min(yen, ans)
    print((ans if ans < impossible else -1))


if __name__ == "__main__":
    resolve()

def resolve():
    import itertools

    impossible = 10**20
    n, m, x = list(map(int, input().split()))
    ans = impossible
    books = [None] * n
    for i in range(n):
        books[i] = list(map(int, input().split()))
    for i in itertools.product([True, False], repeat=n):
        u = [0] * m
        yen = 0
        for index, j in enumerate(i):
            if not j:
                continue
            yen += books[index][0]
            for k in range(m):
                u[k] += books[index][k + 1]
        for j in u:
            if j < x:
                break
        else:
            ans = min(yen, ans)
    print((ans if ans < impossible else -1))


if __name__ == "__main__":
    resolve()

-    for i in list(itertools.product([True, False], repeat=n)): +    for i in itertools.product([True, False], repeat=n):