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

"""

C - Pyramid

https://atcoder.jp/contests/abc112/tasks/abc112_c



"""

import sys





def solve(N, positions):

    if N == 1:

        return positions[0]

    for cy in range(101):

        for cx in range(101):

            is_valid = True

            x, y, h = positions[0]

            ph = h + abs(cy-y) + abs(cx-x)

            for x, y, h in positions[1:]:

                hh = max(ph - abs(cy-y) - abs(cx-x), 0)

                if hh != h:

                    is_valid = False

                    break

            if is_valid:

                return (cx, cy, ph)

    for cy in range(101):

        for cx in range(101):

            is_valid = True

            x, y, h = positions[-1]

            ph = h + abs(cy-y) + abs(cx-x)

            for x, y, h in positions[:-1]:

                hh = max(ph - abs(cy-y) - abs(cx-x), 0)

                if hh != h:

                    is_valid = False

                    break

            if is_valid:

                return (cx, cy, ph)





def main(args):

    N = int(eval(input()))

    positions = [[int(i) for i in input().split()] for _ in range(N)]

    ans = solve(N, positions)

    print((*ans))





if __name__ == '__main__':

    main(sys.argv[1:])

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

"""

C - Pyramid

https://atcoder.jp/contests/abc112/tasks/abc112_c



"""

import sys





def solve(N, positions):

    if N == 1:

        return positions[0]

    positions.sort(key=lambda x:x[2])

    for cy in range(101):

        for cx in range(101):

            is_valid = True

            x, y, h = positions[-1]

            ph = h + abs(cy-y) + abs(cx-x)

            for x, y, h in positions[:-1]:

                hh = max(ph - abs(cy-y) - abs(cx-x), 0)

                if hh != h:

                    is_valid = False

                    break

            if is_valid:

                return (cx, cy, ph)



def main(args):

    N = int(eval(input()))

    positions = [[int(i) for i in input().split()] for _ in range(N)]

    ans = solve(N, positions)

    print((*ans))





if __name__ == '__main__':

    main(sys.argv[1:])

# -*- coding: utf-8 -*-
"""
C - Pyramid
https://atcoder.jp/contests/abc112/tasks/abc112_c
"""
import sys


def solve(N, positions):
    if N == 1:
        return positions[0]
    for cy in range(101):
        for cx in range(101):
            is_valid = True
            x, y, h = positions[0]
            ph = h + abs(cy - y) + abs(cx - x)
            for x, y, h in positions[1:]:
                hh = max(ph - abs(cy - y) - abs(cx - x), 0)
                if hh != h:
                    is_valid = False
                    break
            if is_valid:
                return (cx, cy, ph)
    for cy in range(101):
        for cx in range(101):
            is_valid = True
            x, y, h = positions[-1]
            ph = h + abs(cy - y) + abs(cx - x)
            for x, y, h in positions[:-1]:
                hh = max(ph - abs(cy - y) - abs(cx - x), 0)
                if hh != h:
                    is_valid = False
                    break
            if is_valid:
                return (cx, cy, ph)


def main(args):
    N = int(eval(input()))
    positions = [[int(i) for i in input().split()] for _ in range(N)]
    ans = solve(N, positions)
    print((*ans))


if __name__ == "__main__":
    main(sys.argv[1:])

# -*- coding: utf-8 -*-
"""
C - Pyramid
https://atcoder.jp/contests/abc112/tasks/abc112_c
"""
import sys


def solve(N, positions):
    if N == 1:
        return positions[0]
    positions.sort(key=lambda x: x[2])
    for cy in range(101):
        for cx in range(101):
            is_valid = True
            x, y, h = positions[-1]
            ph = h + abs(cy - y) + abs(cx - x)
            for x, y, h in positions[:-1]:
                hh = max(ph - abs(cy - y) - abs(cx - x), 0)
                if hh != h:
                    is_valid = False
                    break
            if is_valid:
                return (cx, cy, ph)


def main(args):
    N = int(eval(input()))
    positions = [[int(i) for i in input().split()] for _ in range(N)]
    ans = solve(N, positions)
    print((*ans))


if __name__ == "__main__":
    main(sys.argv[1:])

-    for cy in range(101): -        for cx in range(101): -            is_valid = True -            x, y, h = positions[0] -            ph = h + abs(cy - y) + abs(cx - x) -            for x, y, h in positions[1:]: -                hh = max(ph - abs(cy - y) - abs(cx - x), 0) -                if hh != h: -                    is_valid = False -                    break -            if is_valid: -                return (cx, cy, ph) +    positions.sort(key=lambda x: x[2])