N = int(eval(input()))

points = [[int(s) for s in input().split()] for i in range(N)]

h_max = max(h for x, y, h in points)



for H in range(h_max, h_max + 1000):

    for Cx in range(101):

        for Cy in range(101):

            ok = True

            for x, y, h in points:

                h_calc = max(H - abs(x - Cx) - abs(y - Cy), 0)

                if h != h_calc:

                    ok = False

                    break

            if ok:

                print(('{} {} {}'.format(Cx, Cy, H)))

                exit()

N = int(eval(input()))

points = [[int(s) for s in input().split()] for i in range(N)]

points.sort(key=lambda x: x[2], reverse=True)



for Cx in range(101):

    for Cy in range(101):

        kouho = set()

        for xi, yi, hi in points:

            if len(kouho) > 1:

                break  # 頂点が一意でない



            if hi > 0:

                """観測点の高さが1以上なら頂点高を予測"""

                kouho.add(hi + abs(xi - Cx) + abs(yi - Cy))

            else:

                """観測点の高さが0なら式を満たしているかチェック"""

                if list(kouho)[0] - abs(xi - Cx) - abs(yi - Cy) > 0:

                    kouho = set()

                    break



        if len(kouho) == 1:

            print(('{} {} {}'.format(Cx, Cy, list(kouho)[0])))

            exit()

N = int(eval(input()))
points = [[int(s) for s in input().split()] for i in range(N)]
h_max = max(h for x, y, h in points)
for H in range(h_max, h_max + 1000):
    for Cx in range(101):
        for Cy in range(101):
            ok = True
            for x, y, h in points:
                h_calc = max(H - abs(x - Cx) - abs(y - Cy), 0)
                if h != h_calc:
                    ok = False
                    break
            if ok:
                print(("{} {} {}".format(Cx, Cy, H)))
                exit()

N = int(eval(input()))
points = [[int(s) for s in input().split()] for i in range(N)]
points.sort(key=lambda x: x[2], reverse=True)
for Cx in range(101):
    for Cy in range(101):
        kouho = set()
        for xi, yi, hi in points:
            if len(kouho) > 1:
                break  # 頂点が一意でない
            if hi > 0:
                """観測点の高さが1以上なら頂点高を予測"""
                kouho.add(hi + abs(xi - Cx) + abs(yi - Cy))
            else:
                """観測点の高さが0なら式を満たしているかチェック"""
                if list(kouho)[0] - abs(xi - Cx) - abs(yi - Cy) > 0:
                    kouho = set()
                    break
        if len(kouho) == 1:
            print(("{} {} {}".format(Cx, Cy, list(kouho)[0])))
            exit()

-h_max = max(h for x, y, h in points) -for H in range(h_max, h_max + 1000): -    for Cx in range(101): -        for Cy in range(101): -            ok = True -            for x, y, h in points: -                h_calc = max(H - abs(x - Cx) - abs(y - Cy), 0) -                if h != h_calc: -                    ok = False +points.sort(key=lambda x: x[2], reverse=True) +for Cx in range(101): +    for Cy in range(101): +        kouho = set() +        for xi, yi, hi in points: +            if len(kouho) > 1: +                break  # 頂点が一意でない +            if hi > 0: +                """観測点の高さが1以上なら頂点高を予測""" +                kouho.add(hi + abs(xi - Cx) + abs(yi - Cy)) +            else: +                """観測点の高さが0なら式を満たしているかチェック""" +                if list(kouho)[0] - abs(xi - Cx) - abs(yi - Cy) > 0: +                    kouho = set() -            if ok: -                print(("{} {} {}".format(Cx, Cy, H))) -                exit() +        if len(kouho) == 1: +            print(("{} {} {}".format(Cx, Cy, list(kouho)[0]))) +            exit()