N = int(eval(input()))

axis = []



for i in range(N) :

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

    axis.append((x, y, h))



def sol() :

    for cx in range(0, 101) :

        for cy in range(0, 101) :

            axis.sort(key = lambda A : abs(A[0] - cx) + abs(A[1] - cy))

            H = axis[0][2] + abs(axis[0][0] - cx) + abs(axis[0][1] - cy)

            for x, y, h in axis :

                if not h == max(H - abs(x - cx) - abs(y - cy), 0) :

                    break

            else :

                return (cx, cy, H)

    return (-1, -1, -1)



cx, cy, H = sol()

if cx == -1 :

    print('-1')

else :

    print(('{} {} {}'.format(cx, cy, H)))

import sys

import heapq

from operator import itemgetter

from collections import deque, defaultdict

from bisect import bisect_left, bisect_right

input = sys.stdin.readline

sys.setrecursionlimit(10 ** 7)



def sol():

    N = int(eval(input()))

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

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



    for cx in range(101):

        for cy in range(101):

            bx, by, bh = points[0]

            H = bh + abs(cx - bx) + abs(cy - by)

            for x, y, h in points:

                nowH = max(H - abs(cx - x) - abs(cy - y), 0)

                if h != nowH:

                    break

            else:

                print((cx, cy, H))

                return



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


def sol():
    for cx in range(0, 101):
        for cy in range(0, 101):
            axis.sort(key=lambda A: abs(A[0] - cx) + abs(A[1] - cy))
            H = axis[0][2] + abs(axis[0][0] - cx) + abs(axis[0][1] - cy)
            for x, y, h in axis:
                if not h == max(H - abs(x - cx) - abs(y - cy), 0):
                    break
            else:
                return (cx, cy, H)
    return (-1, -1, -1)


cx, cy, H = sol()
if cx == -1:
    print("-1")
else:
    print(("{} {} {}".format(cx, cy, H)))

import sys
import heapq
from operator import itemgetter
from collections import deque, defaultdict
from bisect import bisect_left, bisect_right

input = sys.stdin.readline
sys.setrecursionlimit(10**7)


def sol():
    N = int(eval(input()))
    points = [tuple(map(int, input().split())) for _ in range(N)]
    points.sort(key=itemgetter(2), reverse=True)
    for cx in range(101):
        for cy in range(101):
            bx, by, bh = points[0]
            H = bh + abs(cx - bx) + abs(cy - by)
            for x, y, h in points:
                nowH = max(H - abs(cx - x) - abs(cy - y), 0)
                if h != nowH:
                    break
            else:
                print((cx, cy, H))
                return


sol()

-N = int(eval(input())) -axis = [] -for i in range(N): -    x, y, h = list(map(int, input().split())) -    axis.append((x, y, h)) +import sys +import heapq +from operator import itemgetter +from collections import deque, defaultdict +from bisect import bisect_left, bisect_right + +input = sys.stdin.readline +sys.setrecursionlimit(10**7) -    for cx in range(0, 101): -        for cy in range(0, 101): -            axis.sort(key=lambda A: abs(A[0] - cx) + abs(A[1] - cy)) -            H = axis[0][2] + abs(axis[0][0] - cx) + abs(axis[0][1] - cy) -            for x, y, h in axis: -                if not h == max(H - abs(x - cx) - abs(y - cy), 0): +    N = int(eval(input())) +    points = [tuple(map(int, input().split())) for _ in range(N)] +    points.sort(key=itemgetter(2), reverse=True) +    for cx in range(101): +        for cy in range(101): +            bx, by, bh = points[0] +            H = bh + abs(cx - bx) + abs(cy - by) +            for x, y, h in points: +                nowH = max(H - abs(cx - x) - abs(cy - y), 0) +                if h != nowH: -                return (cx, cy, H) -    return (-1, -1, -1) +                print((cx, cy, H)) +                return -cx, cy, H = sol() -if cx == -1: -    print("-1") -else: -    print(("{} {} {}".format(cx, cy, H))) +sol()