#coding: utf-8

N = int(eval(input()))

l = []

for i in range(N):

    a = list(map(int, input().split()))

    if a[2] > 0:

      l.append(a)

if len(l) >= 2:

    for i in range(len(l)-1):

        ans = []

        for cx in range(101):

            for cy in range(101):

                if l[i][2] + abs(l[i][0] - cx) + abs(l[i][1] - cy) == l[i+1][2] + abs(l[i+1][0] - cx) + abs(l[i+1][1] - cy):

                    if i == 0:

                        ans.append([cx, cy])

                    else:

                        if [cx, cy] in ansn:

                            ans.append([cx, cy])

        ansn = ans[:]

        if len(ans) == 1:

            break

    print((ans[0][0], ans[0][1], l[0][2] + abs(l[0][0] - ans[0][0]) + abs(l[0][1] - ans[0][1])))

else:

    print((l[0][0], l[0][1], l[0][2]))
# coding: utf-8

N = int(eval(input()))

info = []

for i in range(N):

    info.append(list(map(int, input().split())))

# s = False

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

for cx in range(101):

    for cy in range(101):

        flag = True

        s = False

        for i in range(N):

            x, y, h = info[i]

            # if x < 0 or y < 0 or h <= 0:

            #     continue

            if not s:

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

                s = True

                continue

            else:

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

                    flag = False

        if flag:

            print((cx, cy, H))

            exit()

ans = info[0]

for i in range(1, N):

    if ans[2] > info[i][2]:

        ans = info[i]

print((*ans))

# coding: utf-8
N = int(eval(input()))
l = []
for i in range(N):
    a = list(map(int, input().split()))
    if a[2] > 0:
        l.append(a)
if len(l) >= 2:
    for i in range(len(l) - 1):
        ans = []
        for cx in range(101):
            for cy in range(101):
                if l[i][2] + abs(l[i][0] - cx) + abs(l[i][1] - cy) == l[i + 1][2] + abs(
                    l[i + 1][0] - cx
                ) + abs(l[i + 1][1] - cy):
                    if i == 0:
                        ans.append([cx, cy])
                    else:
                        if [cx, cy] in ansn:
                            ans.append([cx, cy])
        ansn = ans[:]
        if len(ans) == 1:
            break
    print(
        (
            ans[0][0],
            ans[0][1],
            l[0][2] + abs(l[0][0] - ans[0][0]) + abs(l[0][1] - ans[0][1]),
        )
    )
else:
    print((l[0][0], l[0][1], l[0][2]))

# coding: utf-8
N = int(eval(input()))
info = []
for i in range(N):
    info.append(list(map(int, input().split())))
# s = False
info.sort(key=lambda x: x[2], reverse=True)
for cx in range(101):
    for cy in range(101):
        flag = True
        s = False
        for i in range(N):
            x, y, h = info[i]
            # if x < 0 or y < 0 or h <= 0:
            #     continue
            if not s:
                H = h + abs(cx - x) + abs(cy - y)
                s = True
                continue
            else:
                if h != max(H - abs(cx - x) - abs(cy - y), 0):
                    flag = False
        if flag:
            print((cx, cy, H))
            exit()
ans = info[0]
for i in range(1, N):
    if ans[2] > info[i][2]:
        ans = info[i]
print((*ans))

-l = [] +info = [] -    a = list(map(int, input().split())) -    if a[2] > 0: -        l.append(a) -if len(l) >= 2: -    for i in range(len(l) - 1): -        ans = [] -        for cx in range(101): -            for cy in range(101): -                if l[i][2] + abs(l[i][0] - cx) + abs(l[i][1] - cy) == l[i + 1][2] + abs( -                    l[i + 1][0] - cx -                ) + abs(l[i + 1][1] - cy): -                    if i == 0: -                        ans.append([cx, cy]) -                    else: -                        if [cx, cy] in ansn: -                            ans.append([cx, cy]) -        ansn = ans[:] -        if len(ans) == 1: -            break -    print( -        ( -            ans[0][0], -            ans[0][1], -            l[0][2] + abs(l[0][0] - ans[0][0]) + abs(l[0][1] - ans[0][1]), -        ) -    ) -else: -    print((l[0][0], l[0][1], l[0][2])) +    info.append(list(map(int, input().split()))) +# s = False +info.sort(key=lambda x: x[2], reverse=True) +for cx in range(101): +    for cy in range(101): +        flag = True +        s = False +        for i in range(N): +            x, y, h = info[i] +            # if x < 0 or y < 0 or h <= 0: +            #     continue +            if not s: +                H = h + abs(cx - x) + abs(cy - y) +                s = True +                continue +            else: +                if h != max(H - abs(cx - x) - abs(cy - y), 0): +                    flag = False +        if flag: +            print((cx, cy, H)) +            exit() +ans = info[0] +for i in range(1, N): +    if ans[2] > info[i][2]: +        ans = info[i] +print((*ans))