Buggy python submission (verdict: Time Limit Exceeded):
import sys
n=int(input())
xyh=[list(map(int,input().split())) for i in range(n)]
#x = [xyh[i][0] for i in range(n)]
#y = [xyh[i][1] for i in range(n)]
h = [xyh[i][2] for i in range(n)]
ch=max(h)
while ch<=10000000000:
  for cx in range(101):
    for cy in range(101):
      flg=0
      for i in range(n):
        if abs(xyh[i][0]-cx)+abs(xyh[i][1]-cy)>ch and xyh[i][2]!=0:
          flg=1
          break
        if abs(xyh[i][0]-cx)+abs(xyh[i][1]-cy)!=ch-xyh[i][2]:
          flg=1
          break
      if flg==0:
        print(cx,cy,ch)
        sys.exit()
  ch+=1   

Fixed submission:
import sys
n=int(input())
xyh=[list(map(int,input().split())) for i in range(n)]
xyh.sort(key=lambda x:x[2],reverse=True)
if xyh[0][2]==0:
  total=0
  for i in range(n):
    total+=xyh[i][0]
  cx=total//n
  total=0
  for i in range(n):
    total+=xyh[i][1]
  cy=total//n
  ch=abs(xyh[0][0]-cx)+abs(xyh[0][1]-cy)
  print(cx,cy,ch)
  sys.exit()  
for cx in range(101):
  for cy in range(101):
    ch=abs(xyh[0][0]-cx)+abs(xyh[0][1]-cy)+xyh[0][2]
    flg=0
    for i in range(n):
      if xyh[i][2]!=max(0, ch-abs(xyh[i][0]-cx)-abs(xyh[i][1]-cy)):
        flg=1
        break
    if flg==0:
      print(cx,cy,ch)
      sys.exit()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n=int(input())
xyh=[list(map(int,input().split())) for i in range(n)]
x = [xyh[i][0] for i in range(n)]
y = [xyh[i][1] for i in range(n)]
h = [xyh[i][2] for i in range(n)]
ch=max(h)
while ch<=10000000000:
  for cx in range(101):
    for cy in range(101):
      flg=0
      for i in range(n):
        if abs(x[i]-cx)+abs(y[i]-cy)!=ch-h[i]:
          flg=1
          break
      if flg==0:
        print(cx,cy,ch)
        sys.exit()
  ch+=1

Fixed submission:
import sys
n=int(input())
xyh=[list(map(int,input().split())) for i in range(n)]
xyh.sort(key=lambda x:x[2],reverse=True)
if xyh[0][2]==0:
  total=0
  for i in range(n):
    total+=xyh[i][0]
  cx=total//n
  total=0
  for i in range(n):
    total+=xyh[i][1]
  cy=total//n
  ch=abs(xyh[0][0]-cx)+abs(xyh[0][1]-cy)
  print(cx,cy,ch)
  sys.exit()  
for cx in range(101):
  for cy in range(101):
    ch=abs(xyh[0][0]-cx)+abs(xyh[0][1]-cy)+xyh[0][2]
    flg=0
    for i in range(n):
      if xyh[i][2]!=max(0, ch-abs(xyh[i][0]-cx)-abs(xyh[i][1]-cy)):
        flg=1
        break
    if flg==0:
      print(cx,cy,ch)
      sys.exit()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n=int(input())
xyh=[list(map(int,input().split())) for i in range(n)]
x = [xyh[i][0] for i in range(n)]
y = [xyh[i][1] for i in range(n)]
h = [xyh[i][2] for i in range(n)]
ch=max(h)
while ch<=10000000000:
  for cx in range(101):
    for cy in range(101):
      flg=0
      for i in range(n):
        if abs(x[i]-cx)+abs(y[i]-cy)!=ch-h[i]:
          flg=1
          break
      if flg==0:
        print(cx,cy,ch)
        sys.exit()
  ch+=1

Fixed submission:
import sys
n=int(input())
xyh=[list(map(int,input().split())) for i in range(n)]
xyh.sort(key=lambda x:x[2],reverse=True)
if xyh[0][2]==0:
  total=0
  for i in range(n):
    total+=xyh[i][0]
  cx=total//n
  total=0
  for i in range(n):
    total+=xyh[i][1]
  cy=total//n
  ch=abs(xyh[0][0]-cx)+abs(xyh[0][1]-cy)
  print(cx,cy,ch)
  sys.exit()  
for cx in range(101):
  for cy in range(101):
    ch=abs(xyh[0][0]-cx)+abs(xyh[0][1]-cy)+xyh[0][2]
    flg=0
    for i in range(n):
      if xyh[i][2]!=max(0, ch-abs(xyh[i][0]-cx)-abs(xyh[i][1]-cy)):
        flg=1
        break
    if flg==0:
      print(cx,cy,ch)
      sys.exit()