import sys

iN = int(eval(input()))

aData = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()]

aData.sort(key=lambda x:x[2],reverse=True)



for cx in range(0,101) :

    for cy in range(0,101) :

        aH = []

        uH = False

        bF = True

        for x,y,z in aData :

            d = abs(x-cx)+abs(y-cy)

            if z > 0 :

                aH.append( z + d )

            else :

                if aH[0] > d:

                    bF = False

                if uH :

                    uH = min(uH,d)

                else :

                    uH = d

        for i in range(1,len(aH)) :

            if aH[0] != aH[i] :

                bF = False

        if uH :

            if uH < aH[0] :

                bF = False

        if bF :

            print((cx,cy,aH[0]))

            exit()

import sys

iN = int(eval(input()))

aData = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()]

aData.sort(key=lambda x:x[2],reverse=True)



for cx in range(0,101) :

    for cy in range(0,101) :

        h = 0

        bF = True

        for x,y,z in aData :

            d = abs(x-cx)+abs(y-cy)

            if z > 0 :

                if h == 0 :

                    h = z + d

                else :

                    if h != z + d:

                        bF = False

                        break

            else :

                if h > d:

                    bF = False

                    break

        if bF :

            print((cx,cy,h))

            exit()

import sys

iN = int(eval(input()))
aData = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()]
aData.sort(key=lambda x: x[2], reverse=True)
for cx in range(0, 101):
    for cy in range(0, 101):
        aH = []
        uH = False
        bF = True
        for x, y, z in aData:
            d = abs(x - cx) + abs(y - cy)
            if z > 0:
                aH.append(z + d)
            else:
                if aH[0] > d:
                    bF = False
                if uH:
                    uH = min(uH, d)
                else:
                    uH = d
        for i in range(1, len(aH)):
            if aH[0] != aH[i]:
                bF = False
        if uH:
            if uH < aH[0]:
                bF = False
        if bF:
            print((cx, cy, aH[0]))
            exit()

import sys

iN = int(eval(input()))
aData = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()]
aData.sort(key=lambda x: x[2], reverse=True)
for cx in range(0, 101):
    for cy in range(0, 101):
        h = 0
        bF = True
        for x, y, z in aData:
            d = abs(x - cx) + abs(y - cy)
            if z > 0:
                if h == 0:
                    h = z + d
                else:
                    if h != z + d:
                        bF = False
                        break
            else:
                if h > d:
                    bF = False
                    break
        if bF:
            print((cx, cy, h))
            exit()

-        aH = [] -        uH = False +        h = 0 -                aH.append(z + d) +                if h == 0: +                    h = z + d +                else: +                    if h != z + d: +                        bF = False +                        break -                if aH[0] > d: +                if h > d: -                if uH: -                    uH = min(uH, d) -                else: -                    uH = d -        for i in range(1, len(aH)): -            if aH[0] != aH[i]: -                bF = False -        if uH: -            if uH < aH[0]: -                bF = False +                    break -            print((cx, cy, aH[0])) +            print((cx, cy, h))