import sys



stdin = sys.stdin



ni = lambda: int(ns())

na = lambda: list(map(int, stdin.readline().split()))

ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces



n = ni()

x_li = []

y_li = []

h_li = []

for i in range(n):

    x, y, h = na()

    x_li.append(x)

    y_li.append(y)

    h_li.append(h)

H = -1

ansX = -1

ansY = -1

flag = False

if h_li.count(0) == len(h_li) - 1:

    idx = h_li.index(1)

    print((x_li[idx], y_li[idx], h_li[idx]))

else:

    for x in range(101):

        for y in range(101):

            for i in range(n):

                tmp = h_li[i] + abs(x_li[i] - x) + abs(y_li[i] - y)

                if H == -1 and h_li[i] != 0:

                    H = tmp

                    ansX = x

                    ansY = y

                elif H == tmp or h_li[i] == 0:

                    if i == n - 1:

                        flag = True

                        break

                else:

                    H = -1

                    break

            if flag:

                break

        if flag:

            break



    print((ansX, ansY, H))
import sys



stdin = sys.stdin



ni = lambda: int(ns())

na = lambda: list(map(int, stdin.readline().split()))

ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces



n = ni()

x_li = []

y_li = []

h_li = []

for i in range(n):

    x, y, h = na()

    x_li.append(x)

    y_li.append(y)

    h_li.append(h)

ans = []

flag = False

for i in range(len(h_li)):

    if h_li[i] > 0:

        idx = i

        break

for x in range(101):

    for y in range(101):

        H = h_li[idx] + abs(x_li[idx] - x) + abs(y_li[idx] - y)

        for i in range(n):

            if h_li[i] == max(H - abs(x_li[i] - x) - abs(y_li[i] - y), 0):

                if i == n - 1:

                    flag = True

                    ans.append([x, y, H])

                    break

            else:

                break

        if flag:

            break

    if flag:

        break

print((*ans[0]))

import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces
n = ni()
x_li = []
y_li = []
h_li = []
for i in range(n):
    x, y, h = na()
    x_li.append(x)
    y_li.append(y)
    h_li.append(h)
H = -1
ansX = -1
ansY = -1
flag = False
if h_li.count(0) == len(h_li) - 1:
    idx = h_li.index(1)
    print((x_li[idx], y_li[idx], h_li[idx]))
else:
    for x in range(101):
        for y in range(101):
            for i in range(n):
                tmp = h_li[i] + abs(x_li[i] - x) + abs(y_li[i] - y)
                if H == -1 and h_li[i] != 0:
                    H = tmp
                    ansX = x
                    ansY = y
                elif H == tmp or h_li[i] == 0:
                    if i == n - 1:
                        flag = True
                        break
                else:
                    H = -1
                    break
            if flag:
                break
        if flag:
            break
    print((ansX, ansY, H))

import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces
n = ni()
x_li = []
y_li = []
h_li = []
for i in range(n):
    x, y, h = na()
    x_li.append(x)
    y_li.append(y)
    h_li.append(h)
ans = []
flag = False
for i in range(len(h_li)):
    if h_li[i] > 0:
        idx = i
        break
for x in range(101):
    for y in range(101):
        H = h_li[idx] + abs(x_li[idx] - x) + abs(y_li[idx] - y)
        for i in range(n):
            if h_li[i] == max(H - abs(x_li[i] - x) - abs(y_li[i] - y), 0):
                if i == n - 1:
                    flag = True
                    ans.append([x, y, H])
                    break
            else:
                break
        if flag:
            break
    if flag:
        break
print((*ans[0]))

-H = -1 -ansX = -1 -ansY = -1 +ans = [] -if h_li.count(0) == len(h_li) - 1: -    idx = h_li.index(1) -    print((x_li[idx], y_li[idx], h_li[idx])) -else: -    for x in range(101): -        for y in range(101): -            for i in range(n): -                tmp = h_li[i] + abs(x_li[i] - x) + abs(y_li[i] - y) -                if H == -1 and h_li[i] != 0: -                    H = tmp -                    ansX = x -                    ansY = y -                elif H == tmp or h_li[i] == 0: -                    if i == n - 1: -                        flag = True -                        break -                else: -                    H = -1 +for i in range(len(h_li)): +    if h_li[i] > 0: +        idx = i +        break +for x in range(101): +    for y in range(101): +        H = h_li[idx] + abs(x_li[idx] - x) + abs(y_li[idx] - y) +        for i in range(n): +            if h_li[i] == max(H - abs(x_li[i] - x) - abs(y_li[i] - y), 0): +                if i == n - 1: +                    flag = True +                    ans.append([x, y, H]) -            if flag: +            else: -    print((ansX, ansY, H)) +    if flag: +        break +print((*ans[0]))