def solve(xyhs):

    for cx in range(100 + 1):

        for cy in range(100 + 1):

            cand = None

            for x, y, h in [xyh for xyh in xyhs if xyh[2] != 0]:

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

                if cand is None:

                    cand = t

                elif cand != t:

                    break

            else:

                for x, y, h in [xyh for xyh in xyhs if xyh[2] == 0]:

                    if abs(x - cx) + abs(y - cy) < cand:

                        break

                else:

                    return cx, cy, cand



    return -1, -1, -1





n = int(eval(input()))

xyhs = tuple(tuple(map(int, input().split())) for _ in range(n))



print((*solve(xyhs)))

def solve():

    for cx in range(100 + 1):

        for cy in range(100 + 1):

            h_cand = None

            for x, y, h in xyh:

                if h == 0:

                    continue

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

                if (h_cand is None) or (h_cand == h_calced):

                    h_cand = h_calced

                else:

                    h_cand = None

                    break



            if h_cand is None:

                continue



            for x, y, h in xyh:

                if h != 0:

                    continue

                if h_cand - abs(x - cx) - abs(y - cy) > 0:

                    h_cand = None

                    break



            if h_cand is None:

                continue



            return cx, cy, h_cand

    return None





n = int(eval(input()))

xyh = tuple(tuple(map(int, input().split())) for _ in range(n))



print((*solve()))

def solve(xyhs):
    for cx in range(100 + 1):
        for cy in range(100 + 1):
            cand = None
            for x, y, h in [xyh for xyh in xyhs if xyh[2] != 0]:
                t = h + abs(x - cx) + abs(y - cy)
                if cand is None:
                    cand = t
                elif cand != t:
                    break
            else:
                for x, y, h in [xyh for xyh in xyhs if xyh[2] == 0]:
                    if abs(x - cx) + abs(y - cy) < cand:
                        break
                else:
                    return cx, cy, cand
    return -1, -1, -1


n = int(eval(input()))
xyhs = tuple(tuple(map(int, input().split())) for _ in range(n))
print((*solve(xyhs)))

def solve():
    for cx in range(100 + 1):
        for cy in range(100 + 1):
            h_cand = None
            for x, y, h in xyh:
                if h == 0:
                    continue
                h_calced = h + abs(x - cx) + abs(y - cy)
                if (h_cand is None) or (h_cand == h_calced):
                    h_cand = h_calced
                else:
                    h_cand = None
                    break
            if h_cand is None:
                continue
            for x, y, h in xyh:
                if h != 0:
                    continue
                if h_cand - abs(x - cx) - abs(y - cy) > 0:
                    h_cand = None
                    break
            if h_cand is None:
                continue
            return cx, cy, h_cand
    return None


n = int(eval(input()))
xyh = tuple(tuple(map(int, input().split())) for _ in range(n))
print((*solve()))

-def solve(xyhs): +def solve(): -            cand = None -            for x, y, h in [xyh for xyh in xyhs if xyh[2] != 0]: -                t = h + abs(x - cx) + abs(y - cy) -                if cand is None: -                    cand = t -                elif cand != t: +            h_cand = None +            for x, y, h in xyh: +                if h == 0: +                    continue +                h_calced = h + abs(x - cx) + abs(y - cy) +                if (h_cand is None) or (h_cand == h_calced): +                    h_cand = h_calced +                else: +                    h_cand = None -            else: -                for x, y, h in [xyh for xyh in xyhs if xyh[2] == 0]: -                    if abs(x - cx) + abs(y - cy) < cand: -                        break -                else: -                    return cx, cy, cand -    return -1, -1, -1 +            if h_cand is None: +                continue +            for x, y, h in xyh: +                if h != 0: +                    continue +                if h_cand - abs(x - cx) - abs(y - cy) > 0: +                    h_cand = None +                    break +            if h_cand is None: +                continue +            return cx, cy, h_cand +    return None -xyhs = tuple(tuple(map(int, input().split())) for _ in range(n)) -print((*solve(xyhs))) +xyh = tuple(tuple(map(int, input().split())) for _ in range(n)) +print((*solve()))