N = int(eval(input()))



xn = []

yn = []

hn = []



for i in range(N):

    xi, yi, hi = list(map(int, input().split()))

    xn.append(xi)

    yn.append(yi)

    hn.append(hi)



for Cx in range(101):

    for Cy in range(101):



        flg = True



        for i in range(N):

            if 0 == hn[i]:

                continue



            h = abs(xn[i] - Cx) + abs(yn[i] - Cy) + hn[i]



            if flg:

                H = h

                flg = False

            else:

                if (H != h):

                    flg = True

                    break



        if flg:

            continue



        for i in range(N):

            if 0 == hn[i]:

                h = abs(xn[i] - Cx) + abs(yn[i] - Cy)

                if h < H:

                    flg = True

                    break



        if flg:

            continue



        print((Cx, Cy, H))

        break



    if not flg:

        break

def main():

    N = int(eval(input()))



    xn = []

    yn = []

    hn = []



    for i in range(N):

        xi, yi, hi = list(map(int, input().split()))

        if hi:

            xn.append(xi)

            yn.append(yi)

            hn.append(hi)



    if len(xn) == 1:

        print((xn[0], yn[0], hn[0]))

        return



    for Cx in range(101):

        for Cy in range(101):



            last = None



            for i in range(len(xn)):

                H = abs(xn[i] - Cx) + abs(yn[i] - Cy) + hn[i]



                if H < 0:

                    continue

                if last:

                    if (last != H):

                        break



                last = H

            else:

                print((Cx, Cy, H))

                return





main()

N = int(eval(input()))
xn = []
yn = []
hn = []
for i in range(N):
    xi, yi, hi = list(map(int, input().split()))
    xn.append(xi)
    yn.append(yi)
    hn.append(hi)
for Cx in range(101):
    for Cy in range(101):
        flg = True
        for i in range(N):
            if 0 == hn[i]:
                continue
            h = abs(xn[i] - Cx) + abs(yn[i] - Cy) + hn[i]
            if flg:
                H = h
                flg = False
            else:
                if H != h:
                    flg = True
                    break
        if flg:
            continue
        for i in range(N):
            if 0 == hn[i]:
                h = abs(xn[i] - Cx) + abs(yn[i] - Cy)
                if h < H:
                    flg = True
                    break
        if flg:
            continue
        print((Cx, Cy, H))
        break
    if not flg:
        break

def main():
    N = int(eval(input()))
    xn = []
    yn = []
    hn = []
    for i in range(N):
        xi, yi, hi = list(map(int, input().split()))
        if hi:
            xn.append(xi)
            yn.append(yi)
            hn.append(hi)
    if len(xn) == 1:
        print((xn[0], yn[0], hn[0]))
        return
    for Cx in range(101):
        for Cy in range(101):
            last = None
            for i in range(len(xn)):
                H = abs(xn[i] - Cx) + abs(yn[i] - Cy) + hn[i]
                if H < 0:
                    continue
                if last:
                    if last != H:
                        break
                last = H
            else:
                print((Cx, Cy, H))
                return


main()

-N = int(eval(input())) -xn = [] -yn = [] -hn = [] -for i in range(N): -    xi, yi, hi = list(map(int, input().split())) -    xn.append(xi) -    yn.append(yi) -    hn.append(hi) -for Cx in range(101): -    for Cy in range(101): -        flg = True -        for i in range(N): -            if 0 == hn[i]: -                continue -            h = abs(xn[i] - Cx) + abs(yn[i] - Cy) + hn[i] -            if flg: -                H = h -                flg = False +def main(): +    N = int(eval(input())) +    xn = [] +    yn = [] +    hn = [] +    for i in range(N): +        xi, yi, hi = list(map(int, input().split())) +        if hi: +            xn.append(xi) +            yn.append(yi) +            hn.append(hi) +    if len(xn) == 1: +        print((xn[0], yn[0], hn[0])) +        return +    for Cx in range(101): +        for Cy in range(101): +            last = None +            for i in range(len(xn)): +                H = abs(xn[i] - Cx) + abs(yn[i] - Cy) + hn[i] +                if H < 0: +                    continue +                if last: +                    if last != H: +                        break +                last = H -                if H != h: -                    flg = True -                    break -        if flg: -            continue -        for i in range(N): -            if 0 == hn[i]: -                h = abs(xn[i] - Cx) + abs(yn[i] - Cy) -                if h < H: -                    flg = True -                    break -        if flg: -            continue -        print((Cx, Cy, H)) -        break -    if not flg: -        break +                print((Cx, Cy, H)) +                return + + +main()