n = int(input())

XYH = []



for _ in range(n):

    x,y,h = map(int,input().split())

    if h != 0:

        XYH.append([x,y,h])



flag = False

ans = XYH[0]

for i in range(101):

    for j in range(101):

        tempH = abs(XYH[0][0] - i) + abs(XYH[0][1] - j) + XYH[0][2]

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

            if abs(x - i) + abs(y - j) + h != tempH:

                flag = False

                break

            else:

                flag = True

        if flag:

            ans = [i,j,tempH]

            break

    if flag:

        break



print(*ans,sep = " ")

from sys import setrecursionlimit

from operator import itemgetter



def main():

    N = int(eval(input()))

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

    XYH.sort(key = itemgetter(2),reverse = True)

    ansx = -1

    ansy = -1

    for cx in range(0,101):

        for cy in range(0,101):

            H = -1

            flag = True

            for x,y,h in XYH:

                if H >= 0:

                    if h != max(H - abs(x - cx) - abs(y - cy),0):

                        flag = False

                        break

                elif h > 0:

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

            if flag:

                ansx = cx

                ansy = cy

                print((ansx,ansy,H))

                return

    return   



if __name__ == "__main__":

    main()
n = int(input())
XYH = []
for _ in range(n):
    x, y, h = map(int, input().split())
    if h != 0:
        XYH.append([x, y, h])
flag = False
ans = XYH[0]
for i in range(101):
    for j in range(101):
        tempH = abs(XYH[0][0] - i) + abs(XYH[0][1] - j) + XYH[0][2]
        for x, y, h in XYH[1:]:
            if abs(x - i) + abs(y - j) + h != tempH:
                flag = False
                break
            else:
                flag = True
        if flag:
            ans = [i, j, tempH]
            break
    if flag:
        break
print(*ans, sep=" ")

from sys import setrecursionlimit
from operator import itemgetter


def main():
    N = int(eval(input()))
    XYH = [list(map(int, input().split())) for _ in range(N)]
    XYH.sort(key=itemgetter(2), reverse=True)
    ansx = -1
    ansy = -1
    for cx in range(0, 101):
        for cy in range(0, 101):
            H = -1
            flag = True
            for x, y, h in XYH:
                if H >= 0:
                    if h != max(H - abs(x - cx) - abs(y - cy), 0):
                        flag = False
                        break
                elif h > 0:
                    H = h + abs(x - cx) + abs(y - cy)
            if flag:
                ansx = cx
                ansy = cy
                print((ansx, ansy, H))
                return
    return


if __name__ == "__main__":
    main()

-n = int(input()) -XYH = [] -for _ in range(n): -    x, y, h = map(int, input().split()) -    if h != 0: -        XYH.append([x, y, h]) -flag = False -ans = XYH[0] -for i in range(101): -    for j in range(101): -        tempH = abs(XYH[0][0] - i) + abs(XYH[0][1] - j) + XYH[0][2] -        for x, y, h in XYH[1:]: -            if abs(x - i) + abs(y - j) + h != tempH: -                flag = False -                break -            else: -                flag = True -        if flag: -            ans = [i, j, tempH] -            break -    if flag: -        break -print(*ans, sep=" ") +from sys import setrecursionlimit +from operator import itemgetter + + +def main(): +    N = int(eval(input())) +    XYH = [list(map(int, input().split())) for _ in range(N)] +    XYH.sort(key=itemgetter(2), reverse=True) +    ansx = -1 +    ansy = -1 +    for cx in range(0, 101): +        for cy in range(0, 101): +            H = -1 +            flag = True +            for x, y, h in XYH: +                if H >= 0: +                    if h != max(H - abs(x - cx) - abs(y - cy), 0): +                        flag = False +                        break +                elif h > 0: +                    H = h + abs(x - cx) + abs(y - cy) +            if flag: +                ansx = cx +                ansy = cy +                print((ansx, ansy, H)) +                return +    return + + +if __name__ == "__main__": +    main()