N = int(eval(input()))

Xs = [list(map(int, input().split(" "))) for _ in range(N)]

"""

input = ["2 3 5","2 1 5","1 2 5","3 2 5"]

input = ["0 0 100", "1 1 98"]

input = ["99 1 191", "100 1 192", "99 0 192"]

Xs = [list(map(int, x.split(" "))) for x in input]

"""



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





def solv(Xs):

    for x in range(101):

        for y in range(101):

            h= Xs[0][2]

            Cx = Xs[0][0]

            Cy = Xs[0][1]

            H = h + abs(x - Cx) + abs(y - Cy)

            for i in range(len(Xs)):

                h = max(H - abs(x - Xs[i][0]) - abs(y - Xs[i][1]), 0)

                if h != Xs[i][2]:

                    break

                if i == len(Xs)-1:

                    print(("%d %d %d" % (x, y, H)))

                    exit(0)





solv(Xs)

N = int(eval(input()))

Xs = [list(map(int, input().split(" "))) for _ in range(N)]

"""

input = ["2 3 5","2 1 5","1 2 5","3 2 5"]

input = ["0 0 100", "1 1 98"]

input = ["99 1 191", "100 1 192", "99 0 192"]

Xs = [list(map(int, x.split(" "))) for x in input]

"""



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





def solv(Xs):

    for x in range(101):

        for y in range(101):

            Cx, Cy, h = tuple(Xs[0])

            H = h + abs(x - Cx) + abs(y - Cy)

            for Cx, Cy, h in Xs:

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

                    break

            else:

                return (x, y, H)





print(("%d %d %d" % solv(Xs)))

N = int(eval(input()))
Xs = [list(map(int, input().split(" "))) for _ in range(N)]
"""
input = ["2 3 5","2 1 5","1 2 5","3 2 5"]
input = ["0 0 100", "1 1 98"]
input = ["99 1 191", "100 1 192", "99 0 192"]
Xs = [list(map(int, x.split(" "))) for x in input]
"""
Xs.sort(key=lambda x: x[2], reverse=True)


def solv(Xs):
    for x in range(101):
        for y in range(101):
            h = Xs[0][2]
            Cx = Xs[0][0]
            Cy = Xs[0][1]
            H = h + abs(x - Cx) + abs(y - Cy)
            for i in range(len(Xs)):
                h = max(H - abs(x - Xs[i][0]) - abs(y - Xs[i][1]), 0)
                if h != Xs[i][2]:
                    break
                if i == len(Xs) - 1:
                    print(("%d %d %d" % (x, y, H)))
                    exit(0)


solv(Xs)

N = int(eval(input()))
Xs = [list(map(int, input().split(" "))) for _ in range(N)]
"""
input = ["2 3 5","2 1 5","1 2 5","3 2 5"]
input = ["0 0 100", "1 1 98"]
input = ["99 1 191", "100 1 192", "99 0 192"]
Xs = [list(map(int, x.split(" "))) for x in input]
"""
Xs.sort(key=lambda x: x[2], reverse=True)


def solv(Xs):
    for x in range(101):
        for y in range(101):
            Cx, Cy, h = tuple(Xs[0])
            H = h + abs(x - Cx) + abs(y - Cy)
            for Cx, Cy, h in Xs:
                if max(H - abs(x - Cx) - abs(y - Cy), 0) != h:
                    break
            else:
                return (x, y, H)


print(("%d %d %d" % solv(Xs)))

-            h = Xs[0][2] -            Cx = Xs[0][0] -            Cy = Xs[0][1] +            Cx, Cy, h = tuple(Xs[0]) -            for i in range(len(Xs)): -                h = max(H - abs(x - Xs[i][0]) - abs(y - Xs[i][1]), 0) -                if h != Xs[i][2]: +            for Cx, Cy, h in Xs: +                if max(H - abs(x - Cx) - abs(y - Cy), 0) != h: -                if i == len(Xs) - 1: -                    print(("%d %d %d" % (x, y, H))) -                    exit(0) +            else: +                return (x, y, H) -solv(Xs) +print(("%d %d %d" % solv(Xs)))