In the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.

The pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).  
Aoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:  
 - C_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.  
 - Additionally, he obtained N pieces of information. The i-th of them is: "the altitude of point (x_i, y_i) is h_i."  
This was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.  

-----Constraints-----
 - N is an integer between 1 and 100 (inclusive).
 - x_i and y_i are integers between 0 and 100 (inclusive).
 - h_i is an integer between 0 and 10^9 (inclusive).
 - The N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.
 - The center coordinates and the height of the pyramid can be uniquely identified.

-----Input-----
Input is given from Standard Input in the following format:  
N
x_1 y_1 h_1
x_2 y_2 h_2
x_3 y_3 h_3
:
x_N y_N h_N

-----Output-----
Print values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.  

-----Sample Input-----
4
2 3 5
2 1 5
1 2 5
3 2 5

-----Sample Output-----
2 2 6

In this case, the center coordinates and the height can be identified as (2, 2) and 6.

Difficulty: introductory

Starter code:

Solutions:
import sys
# import math
# import bisect
# import numpy as np
# from decimal import Decimal
# from numba import njit, i8, u1, b1 #JIT compiler
# from itertools import combinations, product
# from collections import Counter, deque, defaultdict

# sys.setrecursionlimit(10 ** 6)
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.14159265358979323846

def read_str():      return sys.stdin.readline().strip()
def read_int():      return int(sys.stdin.readline().strip())
def read_ints():     return map(int, sys.stdin.readline().strip().split())
def read_ints2(x):   return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())
def read_str_list(): return list(sys.stdin.readline().strip().split())
def read_int_list(): return list(map(int, sys.stdin.readline().strip().split()))
def GCD(a: int, b: int) -> int: return b if a%b==0 else GCD(b, a%b)
def LCM(a: int, b: int) -> int: return (a * b) // GCD(a, b)

def solve(info):
    for Cx in range(101):
        for Cy in range(101):
            height = abs(Cx - info[0][0]) + abs(Cy - info[0][1]) + info[0][2]
            flag = True
            for x,y,h in info[1:]:
                val = max(height - abs(Cx - x) - abs(Cy - y), 0)
                if h == val:
                    continue
                else:
                    flag = False
                    break
            if flag:
                return Cx, Cy, height

def Main():
    n = read_int()
    info = [tuple(read_ints()) for _ in range(n)]
    info.sort(key=lambda x: x[2], reverse=True)

    print(*solve(info))

def __starting_point():
    Main()
__starting_point()

N = int(input())
xs, ys, hs = [],[],[]
for _ in range(N):
    x,y,h = map(int,input().split())
    if h != 0:
        xx,yy,hh = x,y,h
    xs.append(x)
    ys.append(y)
    hs.append(h)
for cx in range(101):
    for cy in range(101):
        H = hh+abs(xx-cx)+abs(yy-cy)
        if all([hs[i] == max(0,H-abs(cx-xs[i])-abs(cy-ys[i])) for i in range(N)]):
            print(cx,cy,H)
            return

#!/usr/bin/env python
# coding: utf-8

# In[1]:


N = int(input())
xyh = []
for _ in range(N):
    xyh.append(list(map(int, input().split())))


# In[4]:


xyh.sort(key=lambda x:x[2],reverse=True)
ans = []
for cx in range(101):
    for cy in range(101):
        x,y,h = xyh[0]
        ch = h + abs(x-cx) + abs(y-cy)
        if all([h == max(ch-abs(x-cx)-abs(y-cy),0) for x,y,h in xyh[1:]]):
            ans = [cx,cy,ch]
            break
    else:
        continue
    break
print((*ans))


# In[ ]:






n = int(input())

x = [0] * n
y = [0] * n
h = [0] * n

for i in range(n):
    x[i], y[i], h[i] = map(int, input().split())

for cx in range(101):
    for cy in range(101):
        H = -1
        for i in range(n):
            if h[i] == 0:
                pass
            else:
                tmp = h[i] + abs(x[i]-cx) + abs(y[i]-cy)
                H = tmp
                break
        flag = True
        for i in range(n):
            if h[i] != max(H-abs(x[i]-cx)-abs(y[i]-cy),0):
                flag = False
                break
        if flag:
            print(cx,cy,H)

n=int(input())
xyh = [list(map(int,input().split())) for i in range(n)]
xyh.sort(key=lambda x:x[2], reverse=True)

ansh=-1
ans=[[]]
flag=True
for cx in range(0,101):
  if flag==False:
    break
    
  for cy in range(0,101):
    ansh = 0
    for pira in xyh:
      if ansh==0:
        ansh=pira[2]+(abs(cx-pira[0])+abs(cy-pira[1]))
        ans[0]=[cx,cy,ansh]
        
      elif len(ans[0])>0 and max(ansh -(abs(cx-pira[0])+abs(cy-pira[1])), 0) != pira[2]:
        ans[0]=[]
    if len(ans[0])>0:
      flag=False
      break
print((*ans[0]))


n=int(input())

xl=[]
yl=[]
hl=[]



for i in range(n):
    xx,yy,hh=list(map(int,input().split()))
    xl.append(xx)
    yl.append(yy)
    hl.append(hh)

for cx in range(0,101):
    for cy in range(0,101):
        ok=True
        for i in range(n):
            x=xl[i]
            y=yl[i]
            h=hl[i]
            if h!=0:
                high = h + abs(x - cx) + abs(y - cy)
                break

        for i in range(n):
            x=xl[i]
            y=yl[i]
            h=hl[i]
            oh=max(high-abs(x-cx)-abs(y-cy),0)
            if h!=oh:
                ok=False
                break
        if ok:
            print(cx,cy,high)
            return

import sys
from itertools import product

input = sys.stdin.readline


def main():
    N = int(input())
    X = [0] * N
    Y = [0] * N
    H = [0] * N
    for i in range(N):
        X[i], Y[i], H[i] = list(map(int, input().split()))

    for Cx, Cy in product(list(range(101)), repeat=2):
        Ch = set()
        Ch_upper = float("inf")
        for x, y, h in zip(X, Y, H):
            a = abs(x - Cx) + abs(y - Cy)
            if h == 0:
                Ch_upper = min(Ch_upper, a)
            else:
                Ch.add(h + a)
        if len(Ch) != 1:
            continue
        else:
            Ch = Ch.pop()
            if Ch <= Ch_upper:
                ans = f"{Cx} {Cy} {Ch}"
                break

    print(ans)


def __starting_point():
    main()

__starting_point()

N=int(input())
xyh=[list(map(int,input().split()))for _ in range(N)]
hxy=[[h,x,y]for x,y,h in xyh]
hxy.sort()
for X in range(101):
    for Y in range(101):
        h,x,y=hxy[-1]
        H=h+abs(X-x)+abs(Y-y)
        if all(h==max(H-abs(X-x)-abs(Y-y),0)for h,x,y in hxy):
            print(X,Y,H)

N = int(input())
XYH_list = [list(map(int, input().split())) for i in range(N)]
XYH_list = sorted(XYH_list, key=lambda x: x[2], reverse=True)

for xi in range(0, 101):
    for yi in range(0, 101):
        tmpH = 0
        for k in range(N):
            x,y,h = XYH_list[k]
            if k == 0:
                tmpH =h + abs(x - xi) + abs(y - yi)
            if h == max((tmpH - abs(x - xi) - abs(y - yi)), 0):
                if k == N - 1:
                    ans = [str(xi), str(yi), str(tmpH)]
                continue
            else:
                break
print(' '.join(ans))

n = int(input())
xyh = []
for i in range(n):
    xyh.append(list(map(int, input().split())))
xyh.sort(key = lambda x: x[2], reverse = True)
for i in range(101):
    for j in range(101):
        h = xyh[0][2] + abs(xyh[0][0] - i) + abs(xyh[0][1] - j)
        flag = True
        for k in range(1, n):
            if xyh[k][2] == 0:
                if abs(xyh[k][0] - i) + abs(xyh[k][1] - j) < h:
                    flag = False
                    break
            else:
                temp = xyh[k][2] + abs(xyh[k][0] - i) + abs(xyh[k][1] - j)
                if h != temp:
                    flag = False
                    break
        if flag == True and h >= 1:
            print(i, j, h)
            break
    if flag == True:
        break

n = int(input())
XYH = [list(map(int, input().split())) for _ in range(n)]
#print(XYH)

for x1, y1, h1 in XYH:
    if h1 > 0:
        for Cx in range(101):
            for Cy in range(101):
                H = h1 + abs(x1 - Cx) + abs(y1 - Cy)
                # print(Cx, Cy, H)
                if all(h == max(H - abs(x - Cx) - abs(y - Cy), 0) for x, y, h in XYH):
                  print(Cx, Cy, H)
                  return

n = int(input())
P = []
for _ in range(n):
  x, y, h = map(int, input().split())
  P.append([h, x, y])
P.sort(reverse=True)

for cx in range(101):
  for cy in range(101):
    H = P[0][0] + abs(P[0][1]-cx) + abs(P[0][2]-cy)
    for i in range(1,n):
      if max(H-abs(P[i][1]-cx)-abs(P[i][2]-cy), 0) != P[i][0]:
        break
    else:
      print(cx, cy, H)
      return

n=int(input())
info=[list(map(int,input().split())) for i in range(n)]
for cx in range(0,101):
    for cy in range(0,101):
        H=-10**20
        lim=10**20
        for l in info:
            x,y,h=l 
            if h==0:
                 lim=min(lim,abs(x-cx)+abs(y-cy))
                 
            else:
                if H!=-10**20 and H!=abs(x-cx)+abs(y-cy)+h :break
                H=abs(x-cx)+abs(y-cy)+h 
            if H>lim:break
        else:
            print(cx,cy,H);return

n = int(input())
hs = [list(map(int, input().split())) for _ in range(n)]
hs.sort(key= lambda x: x[2], reverse = True)

def main():
    for x in range(101):
        for y in range(101):
            height = hs[0][2] + abs(x-hs[0][0]) + abs(y-hs[0][1])
            for i in range(1,n):
                if max(height-(abs(x-hs[i][0]) + abs(y-hs[i][1])),0)== hs[i][2]:
                    pass
                else:
                    break
                
                if i ==n-1:
                    print(x,y,height)
                    return x,y,height
main()

n = int(input())
xyh = [list(map(int, input().split())) for _ in range(n)]

test = [(x,y,h) for x,y,h in xyh if h > 0]
test = test[0]
for cx in range(101):
    for cy in range(101):
        # h > 0で中心座標の高さを見積もる
        x,y,h = test
        H = h + abs(x - cx) + abs(y - cy)

        # 全データに適合するか        
        if all([max(H - abs(x - cx) - abs(y - cy), 0) == h for x,y,h in xyh]):
            print(cx, cy, H)
            return

N = int(input())

Info = [[] for T in range(0,N)]
for I in range(0,N):
    Info[I] = [int(T) for T in input().split()]
Info = sorted(Info,reverse=True,key=lambda X:X[2])
for CX in range(0,101):
    for CY in range(0,101):
        Flag  = True
        BaseH = abs(Info[0][0]-CX)+abs(Info[0][1]-CY)+Info[0][2]
        for I in range(1,N):
            if max(BaseH-abs(Info[I][0]-CX)-abs(Info[I][1]-CY),0)!=Info[I][2]:
                Flag = False
                break
        if Flag:
            Ans = [str(CX),str(CY),str(BaseH)]
            break
    if Flag:
        break
print(' '.join(Ans))

n,*xyh = map(int,open(0).read().split())
a = sorted([(xyh[i*3],xyh[i*3+1],xyh[i*3+2]) for i in range(n)],key=lambda x:x[2],reverse=True)
for i in range(101):
  for j in range(101):
    dh = abs(a[0][0]-i)+abs(a[0][1]-j)+a[0][2]
    for x,y,h in a[1:]:
      if h != max(dh-abs(x-i)-abs(y-j),0):
        break
    else:
      print(i,j,dh)
      return

N = int(input())
P = [list(map(int,input().split())) for n in range(N)]
x,y,h = list(filter(lambda x:x[2],P))[0]

for i in range(101):
  for j in range(101):
    H = h+abs(x-i)+abs(y-j)
    if all(max(H-abs(t[0]-i)-abs(t[1]-j),0)==t[2] for t in P):
      print(i,j,H)

# 初期入力
import sys
input = sys.stdin.readline  #文字列では使わない
N = int(input())
xyh =[0]*N
h_list =[0]*N

for i in range(N):
    x,y,h= (int(i) for i in input().split())
    xyh[i] =x,y,h
    h_list[i] =h

from bisect import bisect_right
xyh.sort(key =lambda x:x[2])
h_list.sort()
ind =bisect_right(h_list,0)
from collections import defaultdict
H =defaultdict(set)

for x,y,h in xyh[ind:]:
    for cx in range(101):
        for cy in range(101):
            xx =x -cx
            yy =y -cy
            if cx <=x and cy <=y:
                H[(cx,cy)].add( (h +xx +yy) )
            elif cx >x and cy <=y:
                H[(cx,cy)].add( (h -xx +yy) )
            elif cx <=x and cy >y:
                H[(cx,cy)].add( (h +xx -yy) )
            elif cx >x and cy >y:
                H[(cx,cy)].add( (h -xx -yy) )
            
#print(xyh)
#H.sort(key =lambda x:x[1])
if len(xyh[ind:]) ==1:
    print(*xyh[-1])
else:
    for k,v in H.items():
    
        if len(v)==1:
            vv =v.pop()
            if 0 <= vv :
                print(*k,vv)
            elif vv <0:
                print(*k,0)

#
# abc112 c
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
2 3 5
2 1 5
1 2 5
3 2 5"""
        output = """2 2 6"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """2
0 0 100
1 1 98"""
        output = """0 0 100"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """3
99 1 191
100 1 192
99 0 192"""
        output = """100 0 193"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """4
59 3 0
64 94 56
5 62 11
3 93 14"""
        output = """55 80 79"""
        self.assertIO(input, output)


def resolve():
    N = int(input())
    XYH = [list(map(int, input().split())) for _ in range(N)]
    XYH.sort(key=lambda x: x[2], reverse=True)

    CX = CY = H = 0
    flag = False
    for cx in range(101):
        if flag == True:
            break
        for cy in range(101):
            H = XYH[0][2]+abs(XYH[0][0]-cx)+abs(XYH[0][1]-cy)
            for xyh in XYH[1:]:
                x, y, h = xyh
                if h != max(H - abs(x-cx) - abs(y-cy), 0):
                    break
            else:
                flag = True
                CX = cx
                CY = cy
                break

    print(f"{CX} {CY} {H}")


def __starting_point():
    # unittest.main()
    resolve()

__starting_point()

N = int(input())
l = []
for i in range(N):
  l.append(list(map(int, input().split())))
  
for x in range(101):
  for y in range(101):
    flag = True
    for i in range(N):
      if l[i][2]>0:
        tmp = abs(x-l[i][0])+abs(y-l[i][1])+l[i][2]
        break
    for i in range(N):
      if l[i][2] != max(tmp-abs(x-l[i][0])-abs(y-l[i][1]), 0):
        flag = False
        break
    if flag:
      print(x, y, tmp)
      return

def resolve():
    n=int(input())
    xyh=[list(map(int,input().split())) for _ in range(n)]
    xyh.sort(key=lambda x:x[2],reverse=True)
    ans=[]
    for cx in range(101):
        for cy in range(101):
            x,y,h=xyh[0]
            ch=h+abs(x-cx)+abs(y-cy)
            if all([h==max(ch-abs(x-cx)-abs(y-cy),0) for x,y,h in xyh[1:]]):
                ans=[cx,cy,ch]
                break
    print(*ans)
resolve()

N = int(input())
p = [0] * N
for i in range(N):
    p[i] = list(map(int, input().split()))

for i in range(N):
    if p[i][2] > 0:
        pp = p[i]

f = 0

for i in range(101):
    for j in range(101):
        H = pp[2] + abs(i - pp[0]) + abs(j - pp[1])
        for k in range(N):
            #print(i, j ,k)
            if p[k][2] != max(H - abs(i - p[k][0]) - abs(j - p[k][1]), 0):
                break
            if k == (N - 1):
                xa = i
                ya = j
                Ha = H
                f = 1
                break
        if f == 1:
            break
    if f == 1:
        break


print(xa, ya, Ha)

import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return list(map(int, input().split()))
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]

def main():
    n = i_input()
    l = [i_list() for i in range(n)]

    L = []

    for i in l:
        if i[2] != 0:
            L.append(i)
    if len(L) == 1:
        print((" ".join(map(str, L[0]))))
        return

    for x in range(101):
        for y in range(101):
            H = L[0][2] + abs(x-L[0][0]) + abs(y-L[0][1])
            flg = True
            for x1, y1, h1 in L[1:]:
                if h1 == 0:
                    pass
                if H != h1 + abs(x-x1) + abs(y-y1):
                    flg = False
                    break
            if flg == True:
                ans = [x,y]
    H = L[0][2] + abs(ans[0]-L[0][0]) + abs(ans[1]-L[0][1])
    print((" ".join(map(str, ans)) +" "+str(H)))


def __starting_point():
    main()

__starting_point()

n = int(input())
xyh = [list(map(int, input().split())) for _ in range(n)]
xyh.sort(key=lambda x: x[2], reverse=True)
ans = []

for cx in range(101):
    for cy in range(101):
        x, y, h = xyh[0]
        ch = h + abs(x - cx) + abs(y - cy)
        if all([h == max(ch - abs(x - cx) - abs(y - cy), 0) for x, y, h in xyh[1:]]):
            ans = [cx, cy, ch]
            break
print(*ans, sep=' ')

n = int(input())
x_list = []
y_list = []
h_list = []

for i in range(n):
    a, b, c = list(map(int, input().split()))
    x_list.append(a)
    y_list.append(b)
    h_list.append(c)

k = h_list.index(max(h_list))

for x in range(101):
    for y in range(101):
        h_max = h_list[k] + abs(x_list[k] - x) + abs(y_list[k] - y)
        
        for j in range(n):
            if h_list[j] == 0 :
                if h_max - (abs(x_list[j] - x) + abs(y_list[j] - y)) > 0 :
                    h_max = -1
            else:
                if h_max != abs(x_list[j] - x) + abs(y_list[j] - y) + h_list[j]:
                    h_max = -1
        
        if h_max != -1:
            print((str(x)+' '+str(y)+ ' '+ str(h_max)))
            break


n = int(input())
if n == 1:
    x, y, h = map(int, input().split())
    print(x, y, h)
    return
s = [list(map(int, input().split())) for _ in range(n)]
for i in range(101):
    for j in range(101):
        h = -1
        ok = 1
        for t in s:
            if t[2] == 0:
                ok += 1
            elif h == -1:
                h = abs(t[0] - i) + abs(t[1] - j) + t[2]
            else:
                h0 = abs(t[0] - i) + abs(t[1] - j) + t[2]
                if h == h0:
                    ok += 1
        if ok == n:
            for t in s:
                if abs(t[0] - i) + abs(t[1] - j) <= h:
                    if not h == abs(t[0] - i) + abs(t[1] - j) + t[2]:
                        ok = 0
                else:
                    if not t[2] == 0:
                        ok = 0
            if ok == n:
                print(i, j, h)
                return

n = int(input())
ab = [list(map(int, input().split())) for _ in range(n)]

for _ in range(0,n):
    if ab[_][2] !=0:
        x = ab[_][0]
        y = ab[_][1]
        h = ab[_][2]
        break

for i in range(101):
    for j in range(101):
        f = True
        l = abs(i-x)+abs(j-y)+h
        for k in range(0,n):
            dx = ab[k][0]
            dy = ab[k][1]
            dh = ab[k][2]
            if max(l-abs(i-dx)-abs(j-dy),0) ==dh:
                pass
            else:
                f = False
        if f:
            ansx =i
            ansy =j
            ansr = l
            break
print(str(ansx)+" "+str(ansy)+" "+str(ansr))

N=int(input())
hyx=[list(map(int,input().split()))[::-1]for _ in range(N)]
R=range(101)
for X in R:
    for Y in R:
        h,y,x=max(hyx)
        H=h+abs(X-x)+abs(Y-y)
        if all(h==max(H-abs(X-x)-abs(Y-y),0)for h,y,x in hyx):
            print(X,Y,H)

#!/usr/bin/env python3



def solve(n,queries):
    def calcTopHeight(h,x,y,cx,cy):
        return h + abs(x-cx) + abs(y-cy)
    def calcHeight(h,x,y,cx,cy):
        return max(h - abs(x-cx) - abs(y-cy), 0)
    cand = [query for query in queries if query[2] != 0][0]
    for cx in range(101):
        for cy in range(101):
            cnt = 0
            probHeight = calcTopHeight(cand[2],cand[0],cand[1],cx,cy)
            for query in queries:
                x,y,h = query
                if calcHeight(probHeight,x,y,cx,cy) == h:
                    cnt += 1
            if cnt == n:
                return cx,cy,probHeight
    return -1,-1,-1


def main():
    N = int(int(input()))
    queries = [list(map(int,input().split())) for _ in range(N)]
    print((*solve(N,queries)))
    return
    # write c


def __starting_point():
    main()

__starting_point()

def main():
	N = int(input())
	info = []
	for i in range(N):
		x, y, h = [int(a) for a in input().split(" ")]
		info.append({"x": x, "y": y, "h": h})
	info.sort(key=lambda f: -f["h"])
	for cx in range(101):
		for cy in range(101):
			H = 0
			for i in range(len(info)):
				h = info[i]["h"] + abs(info[i]["x"] - cx) + abs(info[i]["y"] - cy)
				if i == 0:
					H = h
				else:
					if h != H:
						if (info[i]["h"] == 0 and h < H) or (info[i]["h"] > 0):
							break
			else:
				print(cx, cy, H)
				return 0
	if info[0]["x"] in [0, 100] and info[0]["y"] in [0, 100]:
		print(info[0]["x"], info[0]["y"], info[0]["h"])
		return 0

main()

import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
    
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def LF(): return list(map(float,input().split()))
def Init(H, W, num): return [[num for i in range(W)] for j in range(H)]
    
    
def main():
    N = I()
    L = [LI() for i in range(N)]
    
    for x in range(101):
        for y in range(101):
            max_num = float('inf')
            ans = 0
            res = True
            for xn, yn, hn in L:
                if hn == 0:
                    max_num = min(max_num, abs(x-xn)+abs(y-yn))
                    if max_num == 0:
                        res = False
                        break
                else:
                    temp = abs(x-xn)+abs(y-yn)+hn
                    if ans != 0 and ans != temp:
                        res = False
                        break
                    else:
                        ans = temp
            if (max_num >= 2 and ans == 0) or ans > max_num:
                res = False

            if res:
                if ans != 0:
                    print(x,y,ans)
                else:
                    print(x,y,1)
                return
    
    
    
def __starting_point():
    main()
__starting_point()

import sys
N = int(input())
ls = []
for i in range(N):
    x,y,h = map(int,input().split())
    ls.append([x,y,h])
ls.sort(key=lambda x: -x[2])

for i in range(0,101):
    for j in range(0,101):
        f = True
        H = ls[0][2]+abs(i-ls[0][0])+abs(j-ls[0][1])
        for k in range(1,N):
            if ls[k][2] != 0:
                H1 = ls[k][2]+abs(i-ls[k][0])+abs(j-ls[k][1])
                if H1 != H:
                    f = False
                    break
            else:
                if H > abs(i-ls[k][0])+abs(j-ls[k][1]):
                    f = False
                    break
        if f:
            print(i,j,H)
            return

from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
x = [0]*n
y = [0]*n
h = [0]*n

for i in range(n):
    x[i], y[i], h[i] = MAP()

for i in range(101):
    for j in range(101):
        H = 0
        for k in range(n):
            if h[k] != 0:
                if H == 0 or H == h[k] + abs(x[k]-i) + abs(y[k]-j):
                    H = h[k] + abs(x[k]-i) + abs(y[k]-j)
                else:
                    break
        else:
            for k in range(n):
                if h[k] == 0:
                    if H - abs(x[k]-i) - abs(y[k]-j) <= 0:
                        continue
                    else:
                        break
            else:
                print(i,j,H)

n = int(input())

xy = [[-1 for i in range(101)] for j in range(101)]

x = []
y = []
h = []
for i in range(n):
  xx, yy, hh = map(int, input().split())
  x.append(xx)
  y.append(yy)
  h.append(hh)
  if hh > 0:
    x0, y0, h0, = xx, yy, hh

for i in range(101):
  for j in range(101):
    flg = 0
    tmp = h0 + abs(x0-i) + abs(y0-j)
    for k in range(n):
      if h[k] != max(tmp - abs(x[k]-i) - abs(y[k]-j),0):
        flg = 1
        break
    if flg == 0:
      print (i,j,tmp)
      return

n = int(input())
xyh = []
x0, y0, h0 = None, None, None
for _ in range(n):
    x, y, h = map(int, input().split())
    if h > 0 and x0 is None:
        x0, y0, h0 = x, y, h
    xyh.append([x, y, h])

for cx in range(101):
    for cy in range(101):
        h = h0 + abs(x0 - cx) + abs(y0 - cy)
        done = True
        for xk, yk, hk in xyh:
            h_ = max(h - abs(xk - cx) - abs(yk - cy), 0)
            if h_ != hk:
                done = False
                break
        if done:
            print(f'{cx} {cy} {h}')

N=int(input())
hyx=[list(map(int,input().split()))[::-1]for _ in range(N)]
R=range(101)
for X in R:
    for Y in R:
        h,y,x=max(hyx)
        H=h+abs(X-x)+abs(Y-y)
        if all(h==max(H-abs(X-x)-abs(Y-y),0)for h,y,x in hyx):
            print(X,Y,H)

import sys
from heapq import heappush, heappop
def input(): return sys.stdin.readline().rstrip()
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(mi())


def main():
    n = ii()
    x = [0]*n
    y = [0]*n
    h = [0]*n
    for i in range(n):
        x[i], y[i], h[i] = mi()
    idx = h.index(max(h))
    for cx in range(101):
        for cy in range(101):
            flag = True
            H = abs(cx-x[idx])+abs(cy-y[idx])+h[idx]
            for i in range(n):
                tmp = abs(cx-x[i])+abs(cy-y[i])
                if h[i] == 0:
                    flag &= (tmp >= H)
                else:
                    tmp += h[i]
                    flag &= (tmp==H)
            if flag:
                print(cx, cy, H)
                return
            
            
        
        




def __starting_point():
    main()
__starting_point()

n = int(input())

ans = [[cx, cy, -1] for cx in range(101) for cy in range(101)]
zeroes = []

for i in range(n):
    x, y, h = list(map(int, input().split()))

    if h > 0:
        delete = []

        for j in range(len(ans)):
            cx, cy, ch = ans[j]

            calcH = h + abs(x-cx) + abs(y-cy)
            if ch == -1:
                ans[j][2] = calcH
            else:
                if ch != calcH:
                    delete.append(j)

        while len(delete) > 0:
            del ans[delete.pop()]
    else:
        zeroes.append([x, y])

for x, y in zeroes:
    delete = []

    for j in range(len(ans)):
        cx, cy, ch = ans[j]

        if ch - abs(x-cx) - abs(y-cy) > 0:
            delete.append(j)

    while len(delete) > 0:
        del ans[delete.pop()]

print(" ".join(map(str, ans[0])))

N = int(input())
xyh = [list(map(int,input().split())) for n in range(N)]
xyh.sort(key=lambda x:x[2],reverse=True)#高度１でない情報から高さ定めるため
for X in range(0,101):
    for Y in range(0,101):
        H = xyh[0][2] + abs(xyh[0][0]-X) + abs(xyh[0][1]-Y)
        for i in range(1,N):
            x,y,h = xyh[i]
            if h != max(H - abs(x-X) -abs(y-Y),0):
                break
        else:
            print(X,Y,H)
            break

# -*- coding: utf-8 -*-

def getH(x, cx, y, cy, h):
    return h + abs(x-cx) + abs(y-cy)

N = int(input())
conditions = []
for i in range(N):
    x,y,h = map(int, input().split())
    if h > 0:
        conditions.append([x,y,h])

num_cnd = len(conditions)
if num_cnd==1:
    print(conditions[0][0],conditions[0][1],conditions[0][2])
    return

for cx in range(101):
    for cy in range(101):
        cnt = 0
        h = 0
        for i,cnd in enumerate(conditions):
            h_tmp = getH(cnd[0], cx, cnd[1], cy, cnd[2])
            if h_tmp >= 1:
                if i==0:
                    h = h_tmp
                    cnt += 1
                elif h == h_tmp:
                    cnt += 1
                    if cnt == num_cnd:
                        print(cx,cy,h)
                        return
                else:
                    break
            else:
                break
        

print('No')

import sys

input = sys.stdin.readline
N = int(input())
piramids = []
for _ in range(N):
    x, y, h = map(int, input().split())
    piramids.append((x, y, h))

for cx in range(101):
    for cy in range(101):
        h_cands = set()
        for x, y, h in piramids:
            if h == 0:
                continue
            cand = h + abs(x - cx) + abs(y - cy)
            h_cands.add(cand)

        # 制約として必ず特定できる
        if len(h_cands) == 1:
            for x, y, h in piramids:
                if h != max(cand - abs(x - cx) - abs(y -cy), 0):
                    break
            else:
                print(cx, cy, cand)
                return

n = int(input())
XYH = sorted([list(map(int, input().split())) for _ in range(n)], key=lambda x: -x[2])

for x in range(101):
    for y in range(101):
        hmax = XYH[0][2] + abs(x-XYH[0][0]) + abs(y-XYH[0][1])
        for i in range(n):
            if max(hmax-abs(x-XYH[i][0])-abs(y-XYH[i][1]), 0) != XYH[i][2]:
                break
            if i==n-1:
                print(x, y, hmax)
                return

N=int(input())
L=[list(map(int,input().split())) for i in range(N)]
L.sort(key=lambda x:x[2],reverse=True)
for i in range(101):
  for j in range(101):
    s=L[0][2]+abs(i-L[0][0])+abs(j-L[0][1])
    for l in L[1:]:
      h=l[2]+abs(i-l[0])+abs(j-l[1])
      if s==h:
        continue
      elif l[2]==0 and s<h:
        continue
      else:
        break
    else:
      print(i,j,s)
      return

n = int(input())
xyh = [list(map(int, input().split())) for _ in range(n)]

for i in range(101):
    for j in range(101):
        s = -1
        flag = True
        limit = float('inf')
        for x, y, h in xyh:
            if h != 0:
                H = h + abs(x-i) + abs(y-j)
                if s != -1:
                    if s != H:
                        flag = False
                        break
                s = H
            else:
                limit = min(limit, abs(x-i) + abs(y-j))
        if flag:
            if s != -1 and s <= limit:
                print(i, j, s)
                return
            elif s <= limit and limit == 1:
                print(i, j, 1)
                return

import sys
n = int(input())
xyh = [list(map(int, input().split())) for i in range(n)]
cnt = 0
for i in range(n):
  if xyh[i][2] != 0:
    cnt += 1
if cnt == 1:
  for i in range(n):
    if xyh[i][2] != 0:
      print(" ".join(list(map(str, xyh[i]))))
      return
for i in range(101):
  for j in range(101):
    x = []
    for k in range(n):
      if xyh[k][2] != 0:
        x.append(abs(xyh[k][0]-i)+abs(xyh[k][1]-j)+xyh[k][2])
    if len(set(x)) == 1:
      print(i, j, x[0])

N=int(input())
info=[]
for i in range(N):
  info.append(list(map(int,input().split())))
info=list(filter(lambda x:x[2]!=0,info))
xy_00=max(map(lambda x:x[2]-(x[0]+x[1]),info))
xy_10=max(map(lambda x:x[2]-((100-x[0])+x[1]),info))
xy_01=max(map(lambda x:x[2]-(x[0]+(100-x[1])),info))
xy_11=max(map(lambda x:x[2]-((100-x[0])+(100-x[1])),info))

cx1=(-xy_00+xy_10+100)//2
cx2=(-xy_01+xy_11+100)//2
cy1=(-xy_00+xy_01+100)//2
cy2=(-xy_10+xy_11+100)//2
flag=False
for cx in [cx1,cx2]:
  for cy in [cy1,cy2]:
    ch=info[0][2]+(abs(info[0][0]-cx)+abs(info[0][1]-cy))
    for i in info:
      if not ch==i[2]+abs(cx-i[0])+abs(cy-i[1]):
        break
    else:
      print(f"{cx} {cy} {ch}")
      flag=True
      break
  if flag==True:
    break

N = int(input())

xyh = []
for i in range(N):
    xyh.append(list(map(int,input().split())))

xyh_sorted = sorted(xyh, key=lambda x: x[2], reverse=True)

answer = [0, 0, 0]
for cy in range(0, 101):
    for cx in range(0, 101):
        H = xyh_sorted[0][2] + abs(xyh_sorted[0][0] - cx) + abs(xyh_sorted[0][1] - cy)
        flag = True
        for i in range(1,N):
            h2 = max(H - abs(xyh_sorted[i][0] - cx) - abs(xyh_sorted[i][1] - cy), 0)
            if h2 != xyh_sorted[i][2]:
                flag = False
                break
        if flag:
            answer = [cx, cy, H]
            break
    if flag:
        break

answerString = str(answer[0]) + " " + str(answer[1]) + " " + str(answer[2])
print(answerString)

def dist(h,xi, yi, cx, cy):
    return h + abs(xi - cx) + abs(yi - cy)

N = int(input())
P = []
for i in range(N):
    xi, yi, h= map(int, input().split())
    P.append([h, xi, yi])
P.sort(reverse = True)

for i in range(101):
    for j in range(101):
        H = dist(P[0][0], P[0][1], P[0][2],i, j)
        for p in P[1:]:
            if max(H - abs(p[1]-i)-abs(p[2]-j), 0) != p[0]:
                break
        else:
            print(i, j, H)
            break

N = int(input())

XYs = []
for _ in range(N):
  XYs.append(list(map(int, input().split())))
  
for i in range(101):
  for j in range(101):
    f = 1
    for k in range(N):
      if XYs[k][2] > 0:
        h = XYs[k][2] + abs(XYs[k][0]-i) + abs(XYs[k][1]-j)
        break
    for k in range(N):
      if max(h - abs(XYs[k][0]-i) - abs(XYs[k][1]-j), 0) != XYs[k][2]:
        f = 0
        break
    if f == 1:
      print(i,j,h)
      return

n = int(input())
a = []
for i in range(n):
    _ = list(map(int, input().split()))
    a.append(_)
a = sorted(a, key=lambda x:x[2],reverse = True)

check = False
    
for i in range(101):
    for j in range(101):
        b = 0
        while b < n:
            if b == 0:
                h = abs(i - a[b][0]) + abs(j - a[b][1]) + a[b][2]
                b +=1
            else:
                de = max(h - abs(i - a[b][0]) - abs(j - a[b][1]),0)
                if de == a[b][2]:
                    b+=1
                else:
                    break
        if b == n:
            ans = str(i) + ' ' + str(j) + ' ' +str(h)
            check = True
        if check:
            break
    if check:
        break
print(ans)


n=int(input())
xyh=[]
for i in range(n):
  x,y,h=map(int,input().split())
  xyh.append([h,x,y])
xyh.sort(reverse=True)
ans=0

for cx in range(101):
  for cy in range(101):
    for N in range(n):
      if abs(xyh[0][1]-cx)+abs(xyh[0][2]-cy)+xyh[0][0]>0:
        H=abs(xyh[0][1]-cx)+abs(xyh[0][2]-cy)+xyh[0][0]
      else:
        break
      if xyh[N][0]!=max(H-abs(xyh[N][1]-cx)-abs(xyh[N][2]-cy),0):
        break
      if N == n-1:
        ans=[cx,cy,H]
print(*ans)

n=int(input())
alist=[list(map(int, input().split())) for i in range(n)]
alist.sort(key=lambda x:x[2],reverse=True)
for i in range(101):
  for j in range(101):
    h=abs(alist[0][0]-i)+abs(alist[0][1]-j)+alist[0][2]
    ans=True
    for k in range(n):
      if max((h-abs(alist[k][0]-i)-abs(alist[k][1]-j)),0)!=alist[k][2]:
        ans=False 
    if ans:
      ansx=i
      ansy=j
      ansh=h
print(ansx,ansy,ansh)

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()

    # maxの逆演算のため、hが0なものとそうでないものに分類
    xyh_0 = []
    xyh_not0 = []
    for _ in range(N):
        xyh = LI()
        if xyh[2] == 0:
            xyh_0.append(xyh)
        else:
            xyh_not0.append(xyh)

    for cx, cy in itertools.product(list(range(101)), list(range(101))):
        H = []
        for x, y, h in xyh_not0:
            H.append(h + abs(x - cx) + abs(y - cy))
        # hが0でないものでOKだったら、hが0のもので辻褄が会うかどうか見る
        if len(set(H)) == 1:
            is_ok = True
            for x, y, h in xyh_0:
                if max(H[0] - abs(x - cx) - abs(y - cy), 0) != 0:
                    is_ok = False
            if is_ok:
                ans = (cx, cy, H[0])

    print((*ans))

def __starting_point():
    resolve()

__starting_point()

N=int(input())
l=[list(map(int,input().split())) for i in range(N)]
for i,j,k in l:
   if k>0:
      fx,fy,fh=i,j,k
for i in range(0,101):#x
   for j in range(0,101):#y
      sw=0
      cer_h=fh+abs(fx-i)+abs(fy-j)
      for x,y,h in l:
         if max(cer_h-abs(i-x)-abs(j-y),0)!=h:
            sw=1
            break
      if sw==0:
         print(i,j,cer_h)
         return

def dist(a, b, x, y, h):
    return h + abs(a - x) + abs(b - y)

N = int(input())
P = []
for i in range(N):
    x, y, h = map(int, input().split())
    P.append([h, x, y])
P.sort(reverse = True)

for i in range(101):
    for j in range(101):
        H = dist(i, j, P[0][1], P[0][2], P[0][0])
        for p in P[1:]:
            if max(H - abs(p[1]-i)-abs(p[2]-j), 0) != p[0]:
                break
        else:
            print(i, j, H)
            break

n = int(input())
coords = [tuple(map(int, input().split())) for i in range(n)]
for xt, yt, ht in coords:
    if ht != 0:
        break
x, y, h = -1, -1, -1
for px in range(101):
    for py in range(101):
        flag = True
        htmp = ht + abs(px-xt) + abs(py-yt)
        dxdy = [(abs(px-x1)+abs(py-y1), htmp-h1) for x1, y1, h1 in coords]
        dxdy.sort()
        for i in range(n-1):
            if dxdy[i][0] < dxdy[i+1][0] and dxdy[i][1] > dxdy[i+1][1]:
                flag = False
                break
        for x1, y1, h1 in coords:
            #print (px, py, htmp, x1, y1, h1)
            if h1 == 0:
                continue
            if abs(htmp-h1) != abs(px-x1) + abs(py-y1):
                flag = False
                break
        if flag:
            if htmp > h:
                h = htmp
                x = px
                y = py
print (x, y, h)

N = int(input())
xyh = [list(map(int,input().split())) for i in range(N)]
f = False
for x in range(101):
    for y in range(101):
        for i in range(N):
            if xyh[i][2] != 0:
                H = abs(xyh[i][0]-x) + abs(xyh[i][1]-y) + xyh[i][2]
                break
        for i in range(N):
            if xyh[i][2] == 0 and H - abs(xyh[i][0]-x) - abs(xyh[i][1]-y) > 0:
                break
            if xyh[i][2] != 0 and H != abs(xyh[i][0]-x) + abs(xyh[i][1]-y) + xyh[i][2]:
                break
        else:
            f = True
            break
    if f:
        break
print(x,y,H)

N = int(input())
l = [list(map(int, input().split())) for i in range(N)]
l.sort(key=lambda x: x[2], reverse=True)

for i in range(101):
    for j in range(101):
        h = l[0][2] + abs(i - l[0][0]) + abs(j - l[0][1])
        for k in range(N):
            tmp = max(h - abs(i - l[k][0]) - abs(j - l[k][1]), 0)
            if tmp != l[k][2]:
                break
            elif k == N-1:
                X = i
                Y = j
                H = h
print(X,Y,H)

N=int(input())
xyh=[list(map(int,input().strip().split())) for _ in range(N)]

dp=[[-1 for i in range(101)] for j in range(101)]
for n in range(N):
    dp[xyh[n][0]][xyh[n][1]]=xyh[n][2]

def find_top(x,y,N,xyh):
    find=True
    prev=-1
    for n in range(N):
        if xyh[n][2]!=0:
            top=xyh[n][2]+abs(xyh[n][0]-x)+abs(xyh[n][1]-y)
            if prev==-1:
                prev=top
            else:
                if prev!=top:
                    find=False
                    break
    return find,top

def check_top(x,y,top,N,xyh):
    check=True
    for n in range(N):
        if xyh[n][2]==0:
            if top-abs(xyh[n][0]-x)-abs(xyh[n][1]-y)>0:
                check=False
                break
    return check

fin=False
for x in range(101):
    if fin==True:
        break
    for y in range(101):
        find=find_top(x,y,N,xyh)[0]
        height=find_top(x,y,N,xyh)[1]
        if find and height>=1 and check_top(x,y,height,N,xyh):
            print("{} {} {}".format(x,y,height))
            fin=True