N=int(eval(input()))

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



def calcH(x,y,h,Cx,Cy):

    if h>0:

        return(h+abs(x-Cx)+abs(y-Cy))

    return -1



for Cx in range(100+1):

    for Cy in range(100+1):

        H=-1

        check=[]

        for x,y,h in xyh:

            Hi=calcH(x,y,h,Cx,Cy)

            if Hi==-1:

                check.append(abs(x-Cx)+abs(y-Cy))

                continue

            if H==-1:

                H=Hi

            elif Hi!=H:

                break

        else:

            for c in check:

                if H>c:

                    break

            else:

                print((Cx,Cy,H))

                exit()
import sys

def main():

    input = sys.stdin.readline

    N = int(eval(input()))

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

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



    def check(cx, cy):

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

        tmp = 0

        for x, y, h in xyh:

            d = dist(x,y)

            if h == 0:

                if tmp > d: return -1

            else:

                if tmp != 0 and tmp != h+d: return -1

                tmp = h+d

        return tmp

    

    for x in range(101):

        for y in range(101):

            H = check(x,y)

            if H >= 0:

                print(('{} {} {}'.format(x,y,H)))

                return



if __name__ == '__main__':

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


def calcH(x, y, h, Cx, Cy):
    if h > 0:
        return h + abs(x - Cx) + abs(y - Cy)
    return -1


for Cx in range(100 + 1):
    for Cy in range(100 + 1):
        H = -1
        check = []
        for x, y, h in xyh:
            Hi = calcH(x, y, h, Cx, Cy)
            if Hi == -1:
                check.append(abs(x - Cx) + abs(y - Cy))
                continue
            if H == -1:
                H = Hi
            elif Hi != H:
                break
        else:
            for c in check:
                if H > c:
                    break
            else:
                print((Cx, Cy, H))
                exit()

import sys


def main():
    input = sys.stdin.readline
    N = int(eval(input()))
    xyh = [tuple(map(int, input().split())) for _ in range(N)]
    xyh.sort(reverse=True, key=lambda x: x[2])

    def check(cx, cy):
        def dist(x, y):
            return abs(x - cx) + abs(y - cy)

        tmp = 0
        for x, y, h in xyh:
            d = dist(x, y)
            if h == 0:
                if tmp > d:
                    return -1
            else:
                if tmp != 0 and tmp != h + d:
                    return -1
                tmp = h + d
        return tmp

    for x in range(101):
        for y in range(101):
            H = check(x, y)
            if H >= 0:
                print(("{} {} {}".format(x, y, H)))
                return


if __name__ == "__main__":
    main()

-N = int(eval(input())) -xyh = [list(map(int, input().split())) for _ in range(N)] +import sys -def calcH(x, y, h, Cx, Cy): -    if h > 0: -        return h + abs(x - Cx) + abs(y - Cy) -    return -1 +def main(): +    input = sys.stdin.readline +    N = int(eval(input())) +    xyh = [tuple(map(int, input().split())) for _ in range(N)] +    xyh.sort(reverse=True, key=lambda x: x[2]) + +    def check(cx, cy): +        def dist(x, y): +            return abs(x - cx) + abs(y - cy) + +        tmp = 0 +        for x, y, h in xyh: +            d = dist(x, y) +            if h == 0: +                if tmp > d: +                    return -1 +            else: +                if tmp != 0 and tmp != h + d: +                    return -1 +                tmp = h + d +        return tmp + +    for x in range(101): +        for y in range(101): +            H = check(x, y) +            if H >= 0: +                print(("{} {} {}".format(x, y, H))) +                return -for Cx in range(100 + 1): -    for Cy in range(100 + 1): -        H = -1 -        check = [] -        for x, y, h in xyh: -            Hi = calcH(x, y, h, Cx, Cy) -            if Hi == -1: -                check.append(abs(x - Cx) + abs(y - Cy)) -                continue -            if H == -1: -                H = Hi -            elif Hi != H: -                break -        else: -            for c in check: -                if H > c: -                    break -            else: -                print((Cx, Cy, H)) -                exit() +if __name__ == "__main__": +    main()