from operator import itemgetter

N=int(eval(input()))



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

count=0



xyh.sort(key=itemgetter(2),reverse=True)

for h in xyh:

    if h[2]==0:

        count+=1

for px in range(101):

    for py in range(101):

        judge=0

        base=0

        for i in xyh:

            if i[2]>=1:

                if base==0:

                    base=i[2]+abs(i[0]-px)+abs(i[1]-py)

                    judge+=1

                elif base==i[2]+abs(i[0]-px)+abs(i[1]-py):

                    judge+=1

            else:

                if max(base-abs(i[0]-px)-abs(i[1]-py),0)==0:

                    judge+=1



        if judge==N:

            print((px,py,base))

            break

            

from operator import itemgetter

N = int(eval(input()))

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



XYZ.sort(key=itemgetter(2), reverse=True)



for x in range(101):

    for y in range(0, 101):

        H = XYZ[0][2]+abs(XYZ[0][0]-x)+abs(XYZ[0][1]-y)

        judge = True

        for xyz in XYZ[1:]:

            if xyz[2] == max(H-abs(xyz[0]-x)-abs(xyz[1]-y),0):

                pass

            else:

                judge = False

                break

        if judge:

            X = x

            Y = y

            break

    if judge:

        break

print((X, Y, H))
from operator import itemgetter

N = int(eval(input()))
xyh = [list(map(int, input().split())) for _ in range(N)]
count = 0
xyh.sort(key=itemgetter(2), reverse=True)
for h in xyh:
    if h[2] == 0:
        count += 1
for px in range(101):
    for py in range(101):
        judge = 0
        base = 0
        for i in xyh:
            if i[2] >= 1:
                if base == 0:
                    base = i[2] + abs(i[0] - px) + abs(i[1] - py)
                    judge += 1
                elif base == i[2] + abs(i[0] - px) + abs(i[1] - py):
                    judge += 1
            else:
                if max(base - abs(i[0] - px) - abs(i[1] - py), 0) == 0:
                    judge += 1
        if judge == N:
            print((px, py, base))
            break

from operator import itemgetter

N = int(eval(input()))
XYZ = [list(map(int, input().split())) for _ in range(N)]
XYZ.sort(key=itemgetter(2), reverse=True)
for x in range(101):
    for y in range(0, 101):
        H = XYZ[0][2] + abs(XYZ[0][0] - x) + abs(XYZ[0][1] - y)
        judge = True
        for xyz in XYZ[1:]:
            if xyz[2] == max(H - abs(xyz[0] - x) - abs(xyz[1] - y), 0):
                pass
            else:
                judge = False
                break
        if judge:
            X = x
            Y = y
            break
    if judge:
        break
print((X, Y, H))

-xyh = [list(map(int, input().split())) for _ in range(N)] -count = 0 -xyh.sort(key=itemgetter(2), reverse=True) -for h in xyh: -    if h[2] == 0: -        count += 1 -for px in range(101): -    for py in range(101): -        judge = 0 -        base = 0 -        for i in xyh: -            if i[2] >= 1: -                if base == 0: -                    base = i[2] + abs(i[0] - px) + abs(i[1] - py) -                    judge += 1 -                elif base == i[2] + abs(i[0] - px) + abs(i[1] - py): -                    judge += 1 +XYZ = [list(map(int, input().split())) for _ in range(N)] +XYZ.sort(key=itemgetter(2), reverse=True) +for x in range(101): +    for y in range(0, 101): +        H = XYZ[0][2] + abs(XYZ[0][0] - x) + abs(XYZ[0][1] - y) +        judge = True +        for xyz in XYZ[1:]: +            if xyz[2] == max(H - abs(xyz[0] - x) - abs(xyz[1] - y), 0): +                pass -                if max(base - abs(i[0] - px) - abs(i[1] - py), 0) == 0: -                    judge += 1 -        if judge == N: -            print((px, py, base)) +                judge = False +                break +        if judge: +            X = x +            Y = y +    if judge: +        break +print((X, Y, H))