# -*- coding: utf-8 -*-



N = int(eval(input()))

x = [None] * N

y = [None] * N

h = [None] * N

for i in range(N):

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





def distance(a,b):

    a_x = a[0]

    a_y = a[1]

    b_x = b[0]

    b_y = b[1]



    return abs(a_x - b_x) + abs(a_y - b_y)





for cx in range(101):

    for cy in range(101):

        ans = True

        c = [cx, cy]

        for i in range(N):

            if h[i] != 0:

                ch = distance(c, [x[i], y[i]]) + h[i]

                break

        # ch = distance(c, [x[0], y[0]]) + h[0]  # cx, cyを仮定するとchが定まる

        for i in range(N):

            if max([ch - distance(c, [x[i], y[i]]), 0]) != h[i]:

                ans = False

                break

        if ans:

            break

    if ans:

        break



print((" ".join(list(map(str, [cx, cy, ch])))))
# coding: utf-8



# https://atcoder.jp/contests/abc112





def main():

    N = int(eval(input()))



    x, y, h = [None] * N, [None] * N, [None] * N



    for i in range(N):

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



    for cx in range(0, 101):

        for cy in range(0, 101):

            first = True

            notans = False

            for i in range(N):

                # print(cx, cy, i)

                if h[i] > 0:

                    H = h[i] + abs(x[i]-cx) + abs(y[i]-cy)

                    if first:

                        first = False

                        pre_H = H

                    else:

                        if H != pre_H:

                            break

            if H == pre_H:

                for i in range(N):

                    if h[i] == 0:

                        if H - abs(x[i]-cx) - abs(y[i]-cy) > 0:

                            notans = True

                            break



                if notans:

                    continue



                print((cx, cy, H))

                return None





main()

# print(main())

# -*- coding: utf-8 -*-
N = int(eval(input()))
x = [None] * N
y = [None] * N
h = [None] * N
for i in range(N):
    x[i], y[i], h[i] = list(map(int, input().split()))


def distance(a, b):
    a_x = a[0]
    a_y = a[1]
    b_x = b[0]
    b_y = b[1]
    return abs(a_x - b_x) + abs(a_y - b_y)


for cx in range(101):
    for cy in range(101):
        ans = True
        c = [cx, cy]
        for i in range(N):
            if h[i] != 0:
                ch = distance(c, [x[i], y[i]]) + h[i]
                break
        # ch = distance(c, [x[0], y[0]]) + h[0]  # cx, cyを仮定するとchが定まる
        for i in range(N):
            if max([ch - distance(c, [x[i], y[i]]), 0]) != h[i]:
                ans = False
                break
        if ans:
            break
    if ans:
        break
print((" ".join(list(map(str, [cx, cy, ch])))))

# coding: utf-8
# https://atcoder.jp/contests/abc112
def main():
    N = int(eval(input()))
    x, y, h = [None] * N, [None] * N, [None] * N
    for i in range(N):
        x[i], y[i], h[i] = list(map(int, input().split()))
    for cx in range(0, 101):
        for cy in range(0, 101):
            first = True
            notans = False
            for i in range(N):
                # print(cx, cy, i)
                if h[i] > 0:
                    H = h[i] + abs(x[i] - cx) + abs(y[i] - cy)
                    if first:
                        first = False
                        pre_H = H
                    else:
                        if H != pre_H:
                            break
            if H == pre_H:
                for i in range(N):
                    if h[i] == 0:
                        if H - abs(x[i] - cx) - abs(y[i] - cy) > 0:
                            notans = True
                            break
                if notans:
                    continue
                print((cx, cy, H))
                return None


main()
# print(main())

-# -*- coding: utf-8 -*- -N = int(eval(input())) -x = [None] * N -y = [None] * N -h = [None] * N -for i in range(N): -    x[i], y[i], h[i] = list(map(int, input().split())) +# coding: utf-8 +# https://atcoder.jp/contests/abc112 +def main(): +    N = int(eval(input())) +    x, y, h = [None] * N, [None] * N, [None] * N +    for i in range(N): +        x[i], y[i], h[i] = list(map(int, input().split())) +    for cx in range(0, 101): +        for cy in range(0, 101): +            first = True +            notans = False +            for i in range(N): +                # print(cx, cy, i) +                if h[i] > 0: +                    H = h[i] + abs(x[i] - cx) + abs(y[i] - cy) +                    if first: +                        first = False +                        pre_H = H +                    else: +                        if H != pre_H: +                            break +            if H == pre_H: +                for i in range(N): +                    if h[i] == 0: +                        if H - abs(x[i] - cx) - abs(y[i] - cy) > 0: +                            notans = True +                            break +                if notans: +                    continue +                print((cx, cy, H)) +                return None -def distance(a, b): -    a_x = a[0] -    a_y = a[1] -    b_x = b[0] -    b_y = b[1] -    return abs(a_x - b_x) + abs(a_y - b_y) - - -for cx in range(101): -    for cy in range(101): -        ans = True -        c = [cx, cy] -        for i in range(N): -            if h[i] != 0: -                ch = distance(c, [x[i], y[i]]) + h[i] -                break -        # ch = distance(c, [x[0], y[0]]) + h[0]  # cx, cyを仮定するとchが定まる -        for i in range(N): -            if max([ch - distance(c, [x[i], y[i]]), 0]) != h[i]: -                ans = False -                break -        if ans: -            break -    if ans: -        break -print((" ".join(list(map(str, [cx, cy, ch]))))) +main() +# print(main())