N = int(eval(input()))

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

for x in range(101):

    for y in range(101):

        a,b,h = A[0]

        H = h+abs(x-a)+abs(y-b)

        flag = 1

        for i in range(1,N):

            a,b,h = A[i]

            if max(0,H-abs(x-a)-abs(y-b))==h:continue

            else:

                flag = 0

                break

        if flag==1:

            cx = x

            cy = y

            break

    if flag==1:break

print((cx,cy,H))
def dist(X,Y):

    return abs(X[0]-Y[0])+abs(X[1]-Y[1])

N = int(eval(input()))

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

for i in range(101):

    for j in range(101):

        flag=0

        x0,y0,h0 = A[0]

        H = h0+dist((i,j),(x0,y0))

        for k in range(1,N):

            x,y,h = A[k]

            if h>0 and H==h+dist((i,j),(x,y)):

                continue

            elif h>0 and H!=h+dist((i,j),(x,y)):

                flag=1

                break

            elif h==0 and H<=dist((i,j),(x,y)):

                continue

            elif h==0 and H>dist((i,j),(x,y)):

                flag = 1

                break

        if flag==0:

            Cx = i

            Cy = j

            break

    if flag==0:break

print((Cx,Cy,H))
N = int(eval(input()))
A = sorted(
    [list(map(int, input().split())) for _ in range(N)],
    key=lambda x: x[2],
    reverse=True,
)
for x in range(101):
    for y in range(101):
        a, b, h = A[0]
        H = h + abs(x - a) + abs(y - b)
        flag = 1
        for i in range(1, N):
            a, b, h = A[i]
            if max(0, H - abs(x - a) - abs(y - b)) == h:
                continue
            else:
                flag = 0
                break
        if flag == 1:
            cx = x
            cy = y
            break
    if flag == 1:
        break
print((cx, cy, H))

def dist(X, Y):
    return abs(X[0] - Y[0]) + abs(X[1] - Y[1])


N = int(eval(input()))
A = sorted(
    [list(map(int, input().split())) for _ in range(N)],
    key=lambda x: x[2],
    reverse=True,
)
for i in range(101):
    for j in range(101):
        flag = 0
        x0, y0, h0 = A[0]
        H = h0 + dist((i, j), (x0, y0))
        for k in range(1, N):
            x, y, h = A[k]
            if h > 0 and H == h + dist((i, j), (x, y)):
                continue
            elif h > 0 and H != h + dist((i, j), (x, y)):
                flag = 1
                break
            elif h == 0 and H <= dist((i, j), (x, y)):
                continue
            elif h == 0 and H > dist((i, j), (x, y)):
                flag = 1
                break
        if flag == 0:
            Cx = i
            Cy = j
            break
    if flag == 0:
        break
print((Cx, Cy, H))

+def dist(X, Y): +    return abs(X[0] - Y[0]) + abs(X[1] - Y[1]) + + -for x in range(101): -    for y in range(101): -        a, b, h = A[0] -        H = h + abs(x - a) + abs(y - b) -        flag = 1 -        for i in range(1, N): -            a, b, h = A[i] -            if max(0, H - abs(x - a) - abs(y - b)) == h: +for i in range(101): +    for j in range(101): +        flag = 0 +        x0, y0, h0 = A[0] +        H = h0 + dist((i, j), (x0, y0)) +        for k in range(1, N): +            x, y, h = A[k] +            if h > 0 and H == h + dist((i, j), (x, y)): -            else: -                flag = 0 +            elif h > 0 and H != h + dist((i, j), (x, y)): +                flag = 1 -        if flag == 1: -            cx = x -            cy = y +            elif h == 0 and H <= dist((i, j), (x, y)): +                continue +            elif h == 0 and H > dist((i, j), (x, y)): +                flag = 1 +                break +        if flag == 0: +            Cx = i +            Cy = j -    if flag == 1: +    if flag == 0: -print((cx, cy, H)) +print((Cx, Cy, H))