n=int(eval(input()))

a=[]

for i in range(n):

    x,y,h=list(map(int,input().split()))

    a.append([x,y,h])



def hight(inp):

    cx,cy,x,y,h=inp

    if h==0:

        return -1

    else:

        return abs(x-cx)+abs(y-cy)+h

    

for cx in range(101):

    for cy in range(101):

        H=set()

        for i in range(n):

            h=hight([cx,cy]+a[i])

            if h!=-1:

                H.add(h)

        if len(H)==1:

            flg=True

            for i in H:

                d=i

            for i in range(n):

                x,y,h=a[i]

                if max(0,d-abs(x-cx)-abs(y-cy))!=h:

                    flg=False

            if flg:

                ans=cx,cy,d

print((*ans))

n=int(eval(input()))

p=[]

for i in range(n):

    p.append(tuple(map(int,input().split())))

p.sort(key=lambda x:-x[2])

for j in range(101):

    for k in range(101):

        H=None

        f=1

        for x,y,h in p:

            if h>0 and H==None:

                H=h+abs(x-j)+abs(y-k)

            else:

                if max(0,H-abs(x-j)-abs(y-k))!=h:

                    f=0

        if f:

            print((j,k,H))

            exit()

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


def hight(inp):
    cx, cy, x, y, h = inp
    if h == 0:
        return -1
    else:
        return abs(x - cx) + abs(y - cy) + h


for cx in range(101):
    for cy in range(101):
        H = set()
        for i in range(n):
            h = hight([cx, cy] + a[i])
            if h != -1:
                H.add(h)
        if len(H) == 1:
            flg = True
            for i in H:
                d = i
            for i in range(n):
                x, y, h = a[i]
                if max(0, d - abs(x - cx) - abs(y - cy)) != h:
                    flg = False
            if flg:
                ans = cx, cy, d
print((*ans))

n = int(eval(input()))
p = []
for i in range(n):
    p.append(tuple(map(int, input().split())))
p.sort(key=lambda x: -x[2])
for j in range(101):
    for k in range(101):
        H = None
        f = 1
        for x, y, h in p:
            if h > 0 and H == None:
                H = h + abs(x - j) + abs(y - k)
            else:
                if max(0, H - abs(x - j) - abs(y - k)) != h:
                    f = 0
        if f:
            print((j, k, H))
            exit()

-a = [] +p = [] -    x, y, h = list(map(int, input().split())) -    a.append([x, y, h]) - - -def hight(inp): -    cx, cy, x, y, h = inp -    if h == 0: -        return -1 -    else: -        return abs(x - cx) + abs(y - cy) + h - - -for cx in range(101): -    for cy in range(101): -        H = set() -        for i in range(n): -            h = hight([cx, cy] + a[i]) -            if h != -1: -                H.add(h) -        if len(H) == 1: -            flg = True -            for i in H: -                d = i -            for i in range(n): -                x, y, h = a[i] -                if max(0, d - abs(x - cx) - abs(y - cy)) != h: -                    flg = False -            if flg: -                ans = cx, cy, d -print((*ans)) +    p.append(tuple(map(int, input().split()))) +p.sort(key=lambda x: -x[2]) +for j in range(101): +    for k in range(101): +        H = None +        f = 1 +        for x, y, h in p: +            if h > 0 and H == None: +                H = h + abs(x - j) + abs(y - k) +            else: +                if max(0, H - abs(x - j) - abs(y - k)) != h: +                    f = 0 +        if f: +            print((j, k, H)) +            exit()