#167C

def main():

    import itertools as ite

    import sys, numpy as np

    N,M,X = list(map(int, sys.stdin.readline().split()))

    CA = [np.array(list(map(int, sys.stdin.readline().split()))) for _ in range(N)]

    bit = np.array(list(ite.product([0,1], repeat=N))) #式の展開

    #print(CA)

    #print(bit)

    ans = -1

    for row in bit:

        result = np.array([0 for _ in range(M+1)])

        #print(ans)

        for idx, num in enumerate(row):

            #print(CA[idx]*num)

            result += CA[idx]*num

        if np.all(result[1:]>=X):

            #print(result[0])

            if ans==-1 or ans >result[0]:

                ans = result[0]

    print(ans)

            

        





if __name__=='__main__':

    main()

#167C bit探索

def main():

    import sys, numpy as np

    

    N,M,X =list(map(int, sys.stdin.readline().split()))

    CAB = [tuple(map(int, sys.stdin.readline().split())) for _ in range(N)]

    

    #bit探索

    ans = -1

    for i in range(2**N):

        result = np.array([0 for _ in range(M+1)])

        for j in range(N): #桁(右始まり)

            if ((i>>j) &1) ==1:

                result +=np.array(CAB[N-j-1])

        if np.all(result[1:]>=X):

            if ans==-1 or ans > result[0]:

                ans = result[0]

    print(ans)

   



if __name__=='__main__':

    main()

# 167C
def main():
    import itertools as ite
    import sys, numpy as np

    N, M, X = list(map(int, sys.stdin.readline().split()))
    CA = [np.array(list(map(int, sys.stdin.readline().split()))) for _ in range(N)]
    bit = np.array(list(ite.product([0, 1], repeat=N)))  # 式の展開
    # print(CA)
    # print(bit)
    ans = -1
    for row in bit:
        result = np.array([0 for _ in range(M + 1)])
        # print(ans)
        for idx, num in enumerate(row):
            # print(CA[idx]*num)
            result += CA[idx] * num
        if np.all(result[1:] >= X):
            # print(result[0])
            if ans == -1 or ans > result[0]:
                ans = result[0]
    print(ans)


if __name__ == "__main__":
    main()

# 167C bit探索
def main():
    import sys, numpy as np

    N, M, X = list(map(int, sys.stdin.readline().split()))
    CAB = [tuple(map(int, sys.stdin.readline().split())) for _ in range(N)]
    # bit探索
    ans = -1
    for i in range(2**N):
        result = np.array([0 for _ in range(M + 1)])
        for j in range(N):  # 桁(右始まり)
            if ((i >> j) & 1) == 1:
                result += np.array(CAB[N - j - 1])
        if np.all(result[1:] >= X):
            if ans == -1 or ans > result[0]:
                ans = result[0]
    print(ans)


if __name__ == "__main__":
    main()

-# 167C +# 167C bit探索 -    import itertools as ite -    CA = [np.array(list(map(int, sys.stdin.readline().split()))) for _ in range(N)] -    bit = np.array(list(ite.product([0, 1], repeat=N)))  # 式の展開 -    # print(CA) -    # print(bit) +    CAB = [tuple(map(int, sys.stdin.readline().split())) for _ in range(N)] +    # bit探索 -    for row in bit: +    for i in range(2**N): -        # print(ans) -        for idx, num in enumerate(row): -            # print(CA[idx]*num) -            result += CA[idx] * num +        for j in range(N):  # 桁(右始まり) +            if ((i >> j) & 1) == 1: +                result += np.array(CAB[N - j - 1]) -            # print(result[0])