N,M,X=[int(s) for s in input().split()]

Book=[[int(s) for s in input().split()] for _ in range(N)]

INF=10**7



ans=set()

ans.add(INF)



for n in range(2**N):

  #Bit全探索

  Xls=[0 for i in range(M)]

  cost=0

  for i in range(N):

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

      cost+=Book[i][0]

      for b in range(M):

        Xls[b]+=Book[i][b+1]

    if min(Xls)>=X:

      ans.add(cost)

if min(ans)==INF:

  print((-1))

else:

  print((min(ans)))
N,M,X=[int(s) for s in input().split()]

Book=[[int(s) for s in input().split()] for _ in range(N)]

INF=10**7



ans=set()

ans.add(INF)

#深さ優先探索

def DFS(n,cost,Xls):

  if n==N:

    if min(Xls)>=X:

      ans.add(cost)

  else:

    Xnext=[Xls[i]+Book[n][i+1] for i in range(M)]

    DFS(n+1,cost+Book[n][0],Xnext)

    DFS(n+1,cost,Xls)



DFS(0,0,[0 for _ in range(M)])

if min(ans)==INF:

  print((-1))

else:

  print((min(ans)))
N, M, X = [int(s) for s in input().split()]
Book = [[int(s) for s in input().split()] for _ in range(N)]
INF = 10**7
ans = set()
ans.add(INF)
for n in range(2**N):
    # Bit全探索
    Xls = [0 for i in range(M)]
    cost = 0
    for i in range(N):
        if ((n >> i) & 1) == 1:
            cost += Book[i][0]
            for b in range(M):
                Xls[b] += Book[i][b + 1]
        if min(Xls) >= X:
            ans.add(cost)
if min(ans) == INF:
    print((-1))
else:
    print((min(ans)))

N, M, X = [int(s) for s in input().split()]
Book = [[int(s) for s in input().split()] for _ in range(N)]
INF = 10**7
ans = set()
ans.add(INF)
# 深さ優先探索
def DFS(n, cost, Xls):
    if n == N:
        if min(Xls) >= X:
            ans.add(cost)
    else:
        Xnext = [Xls[i] + Book[n][i + 1] for i in range(M)]
        DFS(n + 1, cost + Book[n][0], Xnext)
        DFS(n + 1, cost, Xls)


DFS(0, 0, [0 for _ in range(M)])
if min(ans) == INF:
    print((-1))
else:
    print((min(ans)))

-for n in range(2**N): -    # Bit全探索 -    Xls = [0 for i in range(M)] -    cost = 0 -    for i in range(N): -        if ((n >> i) & 1) == 1: -            cost += Book[i][0] -            for b in range(M): -                Xls[b] += Book[i][b + 1] +# 深さ優先探索 +def DFS(n, cost, Xls): +    if n == N: +    else: +        Xnext = [Xls[i] + Book[n][i + 1] for i in range(M)] +        DFS(n + 1, cost + Book[n][0], Xnext) +        DFS(n + 1, cost, Xls) + + +DFS(0, 0, [0 for _ in range(M)])