Buggy python submission (verdict: Runtime Error):
n=int(input())
li=[]
cnt=[]
for i in range(n):
    x,y,h=map(int,input().split())
    li.append([x,y,h])
for j in range(0,101):
    for k in range(0,101):
        for l in range(n):
            if li[l][2]!=0:
                cnt.append(li[l][2]+abs(li[l][0]-j)+abs(li[l][1]-k))
            elif l!=0 and li[l][2]==0:
                if cnt[0]-abs(li[l][0]-j)-abs(li[l][1]-k)>0:
                    cnt.append(0)               
        if len(set(cnt))==1 and max(cnt[0]-abs(li[0][0]-j)-abs(li[0][1]-k),0)==li[0][2]:
            ans=[j,k,cnt[0]]
            break
        else:
            cnt=[]

print(ans[0],ans[1],ans[2])                
           
        
        
    
    


Fixed submission:
n=int(input())
li=[]
cnt=[]
for i in range(n):
    x,y,h=map(int,input().split())
    li.append([x,y,h])
li=sorted(li,key=lambda x:x[2],reverse=True)    
for j in range(0,101):
    for k in range(0,101):
        for l in range(n):
            if li[l][2]!=0:
                cnt.append(li[l][2]+abs(li[l][0]-j)+abs(li[l][1]-k))
            elif l!=0 and li[l][2]==0:
                if len(cnt)!=0 and cnt[0]-abs(li[l][0]-j)-abs(li[l][1]-k)>0:
                    cnt.append(0)               
        if len(set(cnt))==1 and cnt[0]-abs(li[0][0]-j)-abs(li[0][1]-k)==li[0][2]:
            ans=[j,k,cnt[0]]
            break
        else:
            cnt=[]

print(ans[0],ans[1],ans[2])

Buggy python submission (verdict: Runtime Error):
n=int(input())
li=[]
cnt=[]
for i in range(n):
    x,y,h=map(int,input().split())
    li.append([x,y,h])
for j in range(0,101):
    for k in range(0,101):
        for l in range(n):
            if li[l][2]!=0:
                cnt.append(li[l][2]+abs(li[l][0]-j)+abs(li[l][1]-k))
            elif l!=0 and li[l][2]==0:
                if cnt[0]-abs(li[l][0]-j)-abs(li[l][1]-k)>0:
                    cnt.append(0)               
        if len(set(cnt))==1 and cnt[0]-abs(li[0][0]-j)-abs(li[0][1]-k)==li[0][2]:
            ans=[j,k,cnt[0]]
            break
        else:
            cnt=[]

print(ans[0],ans[1],ans[2])                
           
        
        
    
    

Fixed submission:
n=int(input())
li=[]
cnt=[]
for i in range(n):
    x,y,h=map(int,input().split())
    li.append([x,y,h])
li=sorted(li,key=lambda x:x[2],reverse=True)    
for j in range(0,101):
    for k in range(0,101):
        for l in range(n):
            if li[l][2]!=0:
                cnt.append(li[l][2]+abs(li[l][0]-j)+abs(li[l][1]-k))
            elif l!=0 and li[l][2]==0:
                if len(cnt)!=0 and cnt[0]-abs(li[l][0]-j)-abs(li[l][1]-k)>0:
                    cnt.append(0)               
        if len(set(cnt))==1 and cnt[0]-abs(li[0][0]-j)-abs(li[0][1]-k)==li[0][2]:
            ans=[j,k,cnt[0]]
            break
        else:
            cnt=[]

print(ans[0],ans[1],ans[2])

Buggy python submission (verdict: Runtime Error):
n=int(input())
li=[]
for i in range(n):
    x,y,h=map(int,input().split())
    li.append([x,y,h])
for j in range(0,101):
    for k in range(0,101):
        H=li[0][2]+abs(li[0][0]-j)+abs(li[0][1]-k)
        for l in range(1,n):
            if H!=li[l][2]+abs(li[l][0]-j)+abs(li[l][1]-k):
                break
            elif H==li[l][2]+abs(li[l][0]-j)+abs(li[l][1]-k) and l==n-1:
                ans=[j,k,H]

print(ans[0],ans[1],ans[2])                
           
        
        
    
    

Fixed submission:
n=int(input())
li=[]
cnt=[]
for i in range(n):
    x,y,h=map(int,input().split())
    li.append([x,y,h])
li=sorted(li,key=lambda x:x[2],reverse=True)    
for j in range(0,101):
    for k in range(0,101):
        for l in range(n):
            if li[l][2]!=0:
                cnt.append(li[l][2]+abs(li[l][0]-j)+abs(li[l][1]-k))
            elif l!=0 and li[l][2]==0:
                if len(cnt)!=0 and cnt[0]-abs(li[l][0]-j)-abs(li[l][1]-k)>0:
                    cnt.append(0)               
        if len(set(cnt))==1 and cnt[0]-abs(li[0][0]-j)-abs(li[0][1]-k)==li[0][2]:
            ans=[j,k,cnt[0]]
            break
        else:
            cnt=[]

print(ans[0],ans[1],ans[2])