import itertools



n = int(input())

x, y, h = [], [], []

for _ in range(n):

    xi, yi, hi = map(int, input().split())

    if hi != 0:

        x.append(xi)

        y.append(yi)

        h.append(hi)

candidate_cx = list(range(min(x), max(x) + 1))

candidate_cy = list(range(min(y), max(y) + 1))



for cx, cy in list(itertools.product(candidate_cx, candidate_cy)):

    adapted = True

    ch = 0

    for xi, yi, hi in zip(x, y, h):

        ch = max(ch, hi + abs(xi - cx) + abs(yi - cy))

    for xi, yi, hi in zip(x, y, h):

        if hi != ch - abs(xi - cx) - abs(yi - cy):

            adapted = False

            break

    if adapted == False:

        continue

    print(cx, cy, ch, sep = ' ')

    exit(0)

import itertools



n = int(input())

x, y, h = [], [], []

for _ in range(n):

    xi, yi, hi = map(int, input().split())

    if hi != 0:

        x.append(xi)

        y.append(yi)

        h.append(hi)

candidate_cx = list(range(min(x), max(x) + 1))

candidate_cy = list(range(min(y), max(y) + 1))



for cx, cy in list(itertools.product(candidate_cx, candidate_cy)):

    adapted = True

    ch = h[0] + abs(x[0] - cx) + abs(y[0] - cy)

    for xi, yi, hi in zip(x, y, h):

        if hi != ch - abs(xi - cx) - abs(yi - cy):

            adapted = False

            break

    if adapted == False:

        continue

    print(cx, cy, ch, sep = ' ')

    exit(0)

import itertools

n = int(input())
x, y, h = [], [], []
for _ in range(n):
    xi, yi, hi = map(int, input().split())
    if hi != 0:
        x.append(xi)
        y.append(yi)
        h.append(hi)
candidate_cx = list(range(min(x), max(x) + 1))
candidate_cy = list(range(min(y), max(y) + 1))
for cx, cy in list(itertools.product(candidate_cx, candidate_cy)):
    adapted = True
    ch = 0
    for xi, yi, hi in zip(x, y, h):
        ch = max(ch, hi + abs(xi - cx) + abs(yi - cy))
    for xi, yi, hi in zip(x, y, h):
        if hi != ch - abs(xi - cx) - abs(yi - cy):
            adapted = False
            break
    if adapted == False:
        continue
    print(cx, cy, ch, sep=" ")
    exit(0)

import itertools

n = int(input())
x, y, h = [], [], []
for _ in range(n):
    xi, yi, hi = map(int, input().split())
    if hi != 0:
        x.append(xi)
        y.append(yi)
        h.append(hi)
candidate_cx = list(range(min(x), max(x) + 1))
candidate_cy = list(range(min(y), max(y) + 1))
for cx, cy in list(itertools.product(candidate_cx, candidate_cy)):
    adapted = True
    ch = h[0] + abs(x[0] - cx) + abs(y[0] - cy)
    for xi, yi, hi in zip(x, y, h):
        if hi != ch - abs(xi - cx) - abs(yi - cy):
            adapted = False
            break
    if adapted == False:
        continue
    print(cx, cy, ch, sep=" ")
    exit(0)

-    ch = 0 -    for xi, yi, hi in zip(x, y, h): -        ch = max(ch, hi + abs(xi - cx) + abs(yi - cy)) +    ch = h[0] + abs(x[0] - cx) + abs(y[0] - cy)