def main():

    N = int(eval(input()))

    p = []

    for i in range(N):

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

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

 

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

    a,b,c = p[-1]

    for i in range(101):

        for j in range(101):

            H = c + abs(a - i) + abs(b - j)

            for x,y,h in p:

                if h != max(H - abs(x - i) - abs(y - j), 0):

                    break

            else:

                print((i,j,H))

                exit()





main()
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()))

    ans = []

    for x in range(101):

        for y in range(101):

            tmp = 0

            for i in range(N):

                if H[i] == 0:

                    continue

                else:

                    tmp = H[i] + abs(X[i] - x) + abs(Y[i] - y)

                    break

            for i in range(N):

                if not (H[i] == max(tmp - abs(X[i] - x) - abs(Y[i] - y),0)):

                    break

            else:

                ans = [x,y,tmp]

                break

    if N == 1:

        if H[0] == 0:

            print((X[0],Y[0],H[0]))

            exit()

    print((*ans))

            







if __name__ == "__main__":

    main()
def main():
    N = int(eval(input()))
    p = []
    for i in range(N):
        x, y, h = list(map(int, input().split()))
        p.append([x, y, h])
    p.sort(key=lambda x: x[2])
    a, b, c = p[-1]
    for i in range(101):
        for j in range(101):
            H = c + abs(a - i) + abs(b - j)
            for x, y, h in p:
                if h != max(H - abs(x - i) - abs(y - j), 0):
                    break
            else:
                print((i, j, H))
                exit()


main()

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()))
    ans = []
    for x in range(101):
        for y in range(101):
            tmp = 0
            for i in range(N):
                if H[i] == 0:
                    continue
                else:
                    tmp = H[i] + abs(X[i] - x) + abs(Y[i] - y)
                    break
            for i in range(N):
                if not (H[i] == max(tmp - abs(X[i] - x) - abs(Y[i] - y), 0)):
                    break
            else:
                ans = [x, y, tmp]
                break
    if N == 1:
        if H[0] == 0:
            print((X[0], Y[0], H[0]))
            exit()
    print((*ans))


if __name__ == "__main__":
    main()

-    p = [] +    X = [0] * N +    Y = [0] * N +    H = [0] * N -        x, y, h = list(map(int, input().split())) -        p.append([x, y, h]) -    p.sort(key=lambda x: x[2]) -    a, b, c = p[-1] -    for i in range(101): -        for j in range(101): -            H = c + abs(a - i) + abs(b - j) -            for x, y, h in p: -                if h != max(H - abs(x - i) - abs(y - j), 0): +        X[i], Y[i], H[i] = list(map(int, input().split())) +    ans = [] +    for x in range(101): +        for y in range(101): +            tmp = 0 +            for i in range(N): +                if H[i] == 0: +                    continue +                else: +                    tmp = H[i] + abs(X[i] - x) + abs(Y[i] - y) +                    break +            for i in range(N): +                if not (H[i] == max(tmp - abs(X[i] - x) - abs(Y[i] - y), 0)): -                print((i, j, H)) -                exit() +                ans = [x, y, tmp] +                break +    if N == 1: +        if H[0] == 0: +            print((X[0], Y[0], H[0])) +            exit() +    print((*ans)) -main() +if __name__ == "__main__": +    main()