Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M, X = map(int, input().split())
C = []
A = [[] for i in range(M)]
resC = []
resA = list(A)

NEW = 0

def update(base):
  #print(NEW,base)
  if base==None:
    return NEW
  return base + NEW

def check(num):
  return num>=X

def check2(*args):
  res = True
  for val in args:
    buf = (val >= X)
    res = res and buf
  return res

for i in range(N):
  buf = list(map(int, input().split()))
  C.append(buf[0])
  for j in range(M):
    A[j].append(buf[j+1])

for i in range(N):
  if i == 0:
    NEW = C[i]
    resC = [0, NEW]
    resA = [[0, A[j][i]] for i in range(M)]
  else:
    NEW = C[i]
    resC = resC + list(map(update, resC))
    for j in range(M):
      NEW = A[j][i]
      resA[j] = resA[j] + list(map(update, resA[j]))

res = list(map(check2, *resA))
#print(np.asarray(resC)[res]) 
if sum(res)==0:
  print(-1)
else:
  print(min(np.asarray(resC)[res]))

Fixed submission:
import numpy as np

N, M, X = map(int, input().split())
C = []
A = [[] for i in range(M)]
resC = []
resA = list(A)

NEW = 0

def update(base):
  #print(NEW,base)
  if base==None:
    return NEW
  return base + NEW

def check(num):
  return num>=X

def check2(*args):
  res = True
  for val in args:
    buf = (val >= X)
    res = res and buf
  return res

for i in range(N):
  buf = list(map(int, input().split()))
  C.append(buf[0])
  for j in range(M):
    A[j].append(buf[j+1])

for i in range(N):
  if i == 0:
    NEW = C[i]
    resC = [0, NEW]
    resA = [[0, A[j][i]] for j in range(M)]
  else:
    NEW = C[i]
    resC = resC + list(map(update, resC))
    for j in range(M):
      NEW = A[j][i]
      resA[j] = resA[j] + list(map(update, resA[j]))

res = list(map(check2, *resA))
#print(np.asarray(resC)[res]) 
if sum(res)==0:
  print(-1)
else:
  print(min(np.asarray(resC)[res]))

Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M, X = map(int, input().split())
C = []
A = [[] for i in range(M)]
resC = []
resA = list(A)

NEW = 0

def update(base):
  #print(NEW,base)
  if base==None:
    return NEW
  return base + NEW

def check(num):
  return num>=X

def check2(*args):
  res = True
  for val in args:
    buf = (val >= X)
    res = res and buf
  return res

for i in range(N):
  buf = list(map(int, input().split()))
  C.append(buf[0])
  for j in range(M):
    A[j].append(buf[j+1])

for i in range(N):
  if i == 0:
    NEW = C[i]
    resC = [0, NEW]
    resA = [[0, A[j][i]] for i in range(M)]
  else:
    NEW = C[i]
    resC = resC + list(map(update, resC))
    for j in range(M):
      NEW = A[j][i]
      resA[j] = resA[j] + list(map(update, resA[j]))

res = list(map(check2, *resA))
#print(np.asarray(resC)[res]) 
if sum(res)==0:
  print(-1)
else:
  print(min(np.asarray(resC)[res]))

Fixed submission:
import numpy as np

N, M, X = map(int, input().split())
C = []
A = [[] for i in range(M)]
resC = []
resA = list(A)

NEW = 0

def update(base):
  #print(NEW,base)
  if base==None:
    return NEW
  return base + NEW

def check(num):
  return num>=X

def check2(*args):
  res = True
  for val in args:
    buf = (val >= X)
    res = res and buf
  return res

for i in range(N):
  buf = list(map(int, input().split()))
  C.append(buf[0])
  for j in range(M):
    A[j].append(buf[j+1])

for i in range(N):
  if i == 0:
    NEW = C[i]
    resC = [0, NEW]
    resA = [[0, A[j][i]] for j in range(M)]
  else:
    NEW = C[i]
    resC = resC + list(map(update, resC))
    for j in range(M):
      NEW = A[j][i]
      resA[j] = resA[j] + list(map(update, resA[j]))

res = list(map(check2, *resA))
#print(np.asarray(resC)[res]) 
if sum(res)==0:
  print(-1)
else:
  print(min(np.asarray(resC)[res]))