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



flag = False

for cx in range(101):

    for cy in range(101):

        needH = -1

        for i in range(N):

            if h[i] > 0:

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

                if needH == -1:

                    needH = H

                else:

                    if needH != H:

                        needH = -2

                        break

        if needH == -2:

            continue

            

        for i in range(N):

            if h[i] == 0:

                dist = abs(x[i] - cx) + abs(y[i] - cy)

                # distの方が大きくなければいけない

                if needH > dist:

                    needH = -2

                    break

        if needH == -2:

            continue

        else:

            flag = True

        if flag:

            break

    if flag:

        break

                    

print((cx, cy, H))

N = int(eval(input()))

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

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

x = [0] * N

y = [0] * N

h = [0] * N

for i in range(N):

    x[i], y[i], h[i] = xyh[i][0], xyh[i][1], xyh[i][2]



flag = False

for cx in range(101):

    for cy in range(101):

        needH = -1

        for i in range(N-1, -1, -1):

            if h[i] > 0:

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

                if needH == -1:

                    needH = H

                else:

                    if needH != H:

                        needH = -2

                        break

            else:

                dist = abs(x[i] - cx) + abs(y[i] - cy)

                # distの方が大きくなければいけない

                if needH > dist:

                    needH = -2

                    break

                    

        if needH == -2:

            continue

        else:

            flag = True

        if flag:

            break

    if flag:

        break



print((cx, cy, H))

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()))
flag = False
for cx in range(101):
    for cy in range(101):
        needH = -1
        for i in range(N):
            if h[i] > 0:
                H = abs(x[i] - cx) + abs(y[i] - cy) + h[i]
                if needH == -1:
                    needH = H
                else:
                    if needH != H:
                        needH = -2
                        break
        if needH == -2:
            continue
        for i in range(N):
            if h[i] == 0:
                dist = abs(x[i] - cx) + abs(y[i] - cy)
                # distの方が大きくなければいけない
                if needH > dist:
                    needH = -2
                    break
        if needH == -2:
            continue
        else:
            flag = True
        if flag:
            break
    if flag:
        break
print((cx, cy, H))

N = int(eval(input()))
xyh = [list(map(int, input().split())) for _ in range(N)]
xyh.sort(key=lambda x: x[2])
x = [0] * N
y = [0] * N
h = [0] * N
for i in range(N):
    x[i], y[i], h[i] = xyh[i][0], xyh[i][1], xyh[i][2]
flag = False
for cx in range(101):
    for cy in range(101):
        needH = -1
        for i in range(N - 1, -1, -1):
            if h[i] > 0:
                H = abs(x[i] - cx) + abs(y[i] - cy) + h[i]
                if needH == -1:
                    needH = H
                else:
                    if needH != H:
                        needH = -2
                        break
            else:
                dist = abs(x[i] - cx) + abs(y[i] - cy)
                # distの方が大きくなければいけない
                if needH > dist:
                    needH = -2
                    break
        if needH == -2:
            continue
        else:
            flag = True
        if flag:
            break
    if flag:
        break
print((cx, cy, H))

+xyh = [list(map(int, input().split())) for _ in range(N)] +xyh.sort(key=lambda x: x[2]) -    x[i], y[i], h[i] = list(map(int, input().split())) +    x[i], y[i], h[i] = xyh[i][0], xyh[i][1], xyh[i][2] -        for i in range(N): +        for i in range(N - 1, -1, -1): -        if needH == -2: -            continue -        for i in range(N): -            if h[i] == 0: +            else: