def main():

    N = int(input())

    xyh = [[int(i) for i in input().split()] for _ in range(N)]

    sx, sy, sh = [(x, y, h) for x, y, h in xyh if h != 0][0]

    for cx in range(101):

        for cy in range(101):

            H = sh + abs(sx - cx) + abs(sy - cy)

            if all(max(H-abs(x - cx)-abs(y - cy), 0) == h for x, y, h in xyh):

                return print(cx, cy, H)





if __name__ == '__main__':

    main()

def main():

    import sys

    input = sys.stdin.buffer.readline

    N = int(input())

    XYH = [[int(i) for i in input().split()] for j in range(N)]

    XYH.sort(reverse=True, key=lambda p: p[2])



    for cy in range(101):

        for cx in range(101):

            ch = XYH[0][2] + abs(XYH[0][0] - cx) + abs(XYH[0][1] - cy)

            for x, y, h in XYH[1:]:

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

                    break

            else:

                if ch != 0:

                    return print(cx, cy, ch)

    print(-1)





if __name__ == '__main__':

    main()

def main():
    N = int(input())
    xyh = [[int(i) for i in input().split()] for _ in range(N)]
    sx, sy, sh = [(x, y, h) for x, y, h in xyh if h != 0][0]
    for cx in range(101):
        for cy in range(101):
            H = sh + abs(sx - cx) + abs(sy - cy)
            if all(max(H - abs(x - cx) - abs(y - cy), 0) == h for x, y, h in xyh):
                return print(cx, cy, H)


if __name__ == "__main__":
    main()

def main():
    import sys

    input = sys.stdin.buffer.readline
    N = int(input())
    XYH = [[int(i) for i in input().split()] for j in range(N)]
    XYH.sort(reverse=True, key=lambda p: p[2])
    for cy in range(101):
        for cx in range(101):
            ch = XYH[0][2] + abs(XYH[0][0] - cx) + abs(XYH[0][1] - cy)
            for x, y, h in XYH[1:]:
                if h != max(ch - abs(x - cx) - abs(y - cy), 0):
                    break
            else:
                if ch != 0:
                    return print(cx, cy, ch)
    print(-1)


if __name__ == "__main__":
    main()

+    import sys + +    input = sys.stdin.buffer.readline -    xyh = [[int(i) for i in input().split()] for _ in range(N)] -    sx, sy, sh = [(x, y, h) for x, y, h in xyh if h != 0][0] -    for cx in range(101): -        for cy in range(101): -            H = sh + abs(sx - cx) + abs(sy - cy) -            if all(max(H - abs(x - cx) - abs(y - cy), 0) == h for x, y, h in xyh): -                return print(cx, cy, H) +    XYH = [[int(i) for i in input().split()] for j in range(N)] +    XYH.sort(reverse=True, key=lambda p: p[2]) +    for cy in range(101): +        for cx in range(101): +            ch = XYH[0][2] + abs(XYH[0][0] - cx) + abs(XYH[0][1] - cy) +            for x, y, h in XYH[1:]: +                if h != max(ch - abs(x - cx) - abs(y - cy), 0): +                    break +            else: +                if ch != 0: +                    return print(cx, cy, ch) +    print(-1)