import sys

from itertools import product



input = sys.stdin.readline





def main():

    N = int(eval(input()))

    X = [0] * N

    Y = [0] * N

    H = [0] * N

    for i in range(N):

        X[i], Y[i], H[i] = list(map(int, input().split()))



    for Cx, Cy in product(list(range(101)), repeat=2):

        Ch = set()

        Ch_upper = float("inf")

        for x, y, h in zip(X, Y, H):

            a = abs(x - Cx) + abs(y - Cy)

            if h == 0:

                Ch_upper = min(Ch_upper, a)

            else:

                Ch.add(h + a)

        if len(Ch) != 1:

            continue

        else:

            Ch = Ch.pop()

            if Ch <= Ch_upper:

                ans = f"{Cx} {Cy} {Ch}"

                break



    print(ans)





if __name__ == "__main__":

    main()

import sys



input = sys.stdin.readline





def main():

    N = int(eval(input()))

    xyh = [None] * N

    for i in range(N):

        xyh[i] = tuple(map(int, input().split()))



    for i in range(N):

        if xyh[i][2] > 0:

            Bx, By, Bh = xyh[i]

            break



    for Cx in range(0, 101):

        for Cy in range(0, 101):

            H = Bh + abs(Bx - Cx) + abs(By - Cy)

            is_ok = True

            for x, y, h in xyh:

                if max(H - abs(x - Cx) - abs(y - Cy), 0) != h:

                    is_ok = False

                    break

            if is_ok:

                print((Cx, Cy, H))

                exit()





if __name__ == "__main__":

    main()

import sys
from itertools import product

input = sys.stdin.readline


def main():
    N = int(eval(input()))
    X = [0] * N
    Y = [0] * N
    H = [0] * N
    for i in range(N):
        X[i], Y[i], H[i] = list(map(int, input().split()))
    for Cx, Cy in product(list(range(101)), repeat=2):
        Ch = set()
        Ch_upper = float("inf")
        for x, y, h in zip(X, Y, H):
            a = abs(x - Cx) + abs(y - Cy)
            if h == 0:
                Ch_upper = min(Ch_upper, a)
            else:
                Ch.add(h + a)
        if len(Ch) != 1:
            continue
        else:
            Ch = Ch.pop()
            if Ch <= Ch_upper:
                ans = f"{Cx} {Cy} {Ch}"
                break
    print(ans)


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline


def main():
    N = int(eval(input()))
    xyh = [None] * N
    for i in range(N):
        xyh[i] = tuple(map(int, input().split()))
    for i in range(N):
        if xyh[i][2] > 0:
            Bx, By, Bh = xyh[i]
            break
    for Cx in range(0, 101):
        for Cy in range(0, 101):
            H = Bh + abs(Bx - Cx) + abs(By - Cy)
            is_ok = True
            for x, y, h in xyh:
                if max(H - abs(x - Cx) - abs(y - Cy), 0) != h:
                    is_ok = False
                    break
            if is_ok:
                print((Cx, Cy, H))
                exit()


if __name__ == "__main__":
    main()

-from itertools import product -    X = [0] * N -    Y = [0] * N -    H = [0] * N +    xyh = [None] * N -        X[i], Y[i], H[i] = list(map(int, input().split())) -    for Cx, Cy in product(list(range(101)), repeat=2): -        Ch = set() -        Ch_upper = float("inf") -        for x, y, h in zip(X, Y, H): -            a = abs(x - Cx) + abs(y - Cy) -            if h == 0: -                Ch_upper = min(Ch_upper, a) -            else: -                Ch.add(h + a) -        if len(Ch) != 1: -            continue -        else: -            Ch = Ch.pop() -            if Ch <= Ch_upper: -                ans = f"{Cx} {Cy} {Ch}" -                break -    print(ans) +        xyh[i] = tuple(map(int, input().split())) +    for i in range(N): +        if xyh[i][2] > 0: +            Bx, By, Bh = xyh[i] +            break +    for Cx in range(0, 101): +        for Cy in range(0, 101): +            H = Bh + abs(Bx - Cx) + abs(By - Cy) +            is_ok = True +            for x, y, h in xyh: +                if max(H - abs(x - Cx) - abs(y - Cy), 0) != h: +                    is_ok = False +                    break +            if is_ok: +                print((Cx, Cy, H)) +                exit()