Buggy python submission (verdict: Runtime Error):
N=int(input())
ls=[[int(s) for s in input().split()] for i in range(N)]
flag2=1
for i in range(N):
  if ls[i][2]!=0:
    a=ls[i][0]
    b=ls[i][1]
    h_base=ls[i][2]
    ls.pop(i)
    flag2=0
    break
if flag2==0:
  for x in range(101):
    for y in range(101):
      ##x,yの高さを計算
      h=h_base+abs(x-a)+abs(y-b)
      ##他の条件と合うか？
      flag=1
      for e in ls:
        if h!=e[2]+abs(x-e[0])+abs(y-e[1]):
          flag=0
          break
      if flag==1:
        ans=[x,y,h]
        break
    if flag==1:
      break
else:
  xsum=0
  ysum=0
  for e in ls:
    xsum+=e[0]
    ysum+=e[1]
  ans=[5050*101-xsum,5050*101-ysum,1]
print(*ans)  
      
        
      
      
    
  


Fixed submission:
N=int(input())
ls=[[int(s) for s in input().split()] for i in range(N)]
ans=[0,0,0]
for i in range(N):
  if ls[i][2]!=0:
    a=ls[i][0]
    b=ls[i][1]
    h_base=ls[i][2]
    ls.pop(i)
    break
for x in range(101):
  for y in range(101):
    ##x,yの高さを計算
    h=h_base+abs(x-a)+abs(y-b)
    ##他の条件と合うか？
    flag=1
    for e in ls:
      if (h!=e[2]+abs(x-e[0])+abs(y-e[1]) and e[2]>0): 
        flag=0
        break
      if (h>e[2]+abs(x-e[0])+abs(y-e[1]) and e[2]==0):
        flag=0
        break
    if flag==1:
      ans=[x,y,h]
      break
  if flag==1:
    break
print(*ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
ls=[[int(s) for s in input().split()] for i in range(N)]
flag2=1
for i in range(N):
  if ls[i][2]!=0:
    a=ls[i][0]
    b=ls[i][1]
    h_base=ls[i][2]
    ls.pop(i)
    flag2=0
    break
if flag2==0:
  for x in range(101):
    for y in range(101):
      ##x,yの高さを計算
      h=h_base+abs(x-a)+abs(y-b)
      ##他の条件と合うか？
      flag=1
      for e in ls:
        if h!=e[2]+abs(x-e[0])+abs(y-e[1]):
          flag=0
          break
      if flag==1:
        ans=[x,y,h]
        break
    if flag==1:
      break
else:
  xsum=0
  ysum=0
  for e in ls:
    xsum+=e[0]
    ysum+=e[1]
  ans=[5050-xsum,5050-ysum,1]
print(*ans)  
      
        
      
      
    
  

Fixed submission:
N=int(input())
ls=[[int(s) for s in input().split()] for i in range(N)]
ans=[0,0,0]
for i in range(N):
  if ls[i][2]!=0:
    a=ls[i][0]
    b=ls[i][1]
    h_base=ls[i][2]
    ls.pop(i)
    break
for x in range(101):
  for y in range(101):
    ##x,yの高さを計算
    h=h_base+abs(x-a)+abs(y-b)
    ##他の条件と合うか？
    flag=1
    for e in ls:
      if (h!=e[2]+abs(x-e[0])+abs(y-e[1]) and e[2]>0): 
        flag=0
        break
      if (h>e[2]+abs(x-e[0])+abs(y-e[1]) and e[2]==0):
        flag=0
        break
    if flag==1:
      ans=[x,y,h]
      break
  if flag==1:
    break
print(*ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
ls=[[int(s) for s in input().split()] for i in range(N)]
flag2=0
for i in range(N):
  if ls[i][2]!=0:
    a=ls[i][0]
    b=ls[i][1]
    h_base=ls[i][2]
    ls.pop(i)
    break
else:
  flag2=1
if flag2==0:
  for x in range(101):
    for y in range(101):
      ##x,yの高さを計算
      h=h_base+abs(x-a)+abs(y-b)
      ##他の条件と合うか？
      flag=1
      for e in ls:
        if h!=e[2]+abs(x-e[0])+abs(y-e[1]):
          flag=0
          break
      if flag==1:
        ans=[x,y,h]
        break
    if flag==1:
      break
else:
  xsum=0
  ysum=0
  for e in ls:
    xsum+=e[0]
    ysum+=e[1]
  ans=[5050-xsum,5050-ysum,1]
print(*ans)  
      
        
      
      
    
  

Fixed submission:
N=int(input())
ls=[[int(s) for s in input().split()] for i in range(N)]
ans=[0,0,0]
for i in range(N):
  if ls[i][2]!=0:
    a=ls[i][0]
    b=ls[i][1]
    h_base=ls[i][2]
    ls.pop(i)
    break
for x in range(101):
  for y in range(101):
    ##x,yの高さを計算
    h=h_base+abs(x-a)+abs(y-b)
    ##他の条件と合うか？
    flag=1
    for e in ls:
      if (h!=e[2]+abs(x-e[0])+abs(y-e[1]) and e[2]>0): 
        flag=0
        break
      if (h>e[2]+abs(x-e[0])+abs(y-e[1]) and e[2]==0):
        flag=0
        break
    if flag==1:
      ans=[x,y,h]
      break
  if flag==1:
    break
print(*ans)