n = int(eval(input()))



L = [[0, 0, 0] for _ in range(n)]

for i in range(n):

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

    L[i][0] = x

    L[i][1] = y

    L[i][2] = h



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



for i in range(0, 101):

    for j in range(0, 101):

        temp = []

        border = float('inf')

        for k in range(n):

            x = L[k][0]

            y = L[k][1]

            h = L[k][2]

            if h > 0:

                H = abs(i-x)+abs(j-y)+h

                temp.append(H)

            else:

                border = min(border, abs(i-x)+abs(j-y))

        temp = list(set(temp))

        if len(temp) == 1 and temp[0] <= border:

            ans = [i, j, H]

print((*ans))

n = int(eval(input()))

HXY = []

for i in range(n):

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

    HXY.append((h, x, y))



HXY.sort(reverse=True)



for i in range(101):

    for j in range(101):

        H = -1

        for k in range(n):

            h, x, y = HXY[k]

            if h > 0:

                temp = h + abs(x-i) + abs(y-j)

                if H > 0:

                    if H != temp:

                        break

                else:

                    H = temp

            else:

                if H - abs(x-i) - abs(y-j) > 0:

                    break

        else:

            if H > 0:

                print((i, j, H))

n = int(eval(input()))
L = [[0, 0, 0] for _ in range(n)]
for i in range(n):
    x, y, h = list(map(int, input().split()))
    L[i][0] = x
    L[i][1] = y
    L[i][2] = h
L.sort(key=lambda x: x[2], reverse=True)
for i in range(0, 101):
    for j in range(0, 101):
        temp = []
        border = float("inf")
        for k in range(n):
            x = L[k][0]
            y = L[k][1]
            h = L[k][2]
            if h > 0:
                H = abs(i - x) + abs(j - y) + h
                temp.append(H)
            else:
                border = min(border, abs(i - x) + abs(j - y))
        temp = list(set(temp))
        if len(temp) == 1 and temp[0] <= border:
            ans = [i, j, H]
print((*ans))

n = int(eval(input()))
HXY = []
for i in range(n):
    x, y, h = list(map(int, input().split()))
    HXY.append((h, x, y))
HXY.sort(reverse=True)
for i in range(101):
    for j in range(101):
        H = -1
        for k in range(n):
            h, x, y = HXY[k]
            if h > 0:
                temp = h + abs(x - i) + abs(y - j)
                if H > 0:
                    if H != temp:
                        break
                else:
                    H = temp
            else:
                if H - abs(x - i) - abs(y - j) > 0:
                    break
        else:
            if H > 0:
                print((i, j, H))

-L = [[0, 0, 0] for _ in range(n)] +HXY = [] -    L[i][0] = x -    L[i][1] = y -    L[i][2] = h -L.sort(key=lambda x: x[2], reverse=True) -for i in range(0, 101): -    for j in range(0, 101): -        temp = [] -        border = float("inf") +    HXY.append((h, x, y)) +HXY.sort(reverse=True) +for i in range(101): +    for j in range(101): +        H = -1 -            x = L[k][0] -            y = L[k][1] -            h = L[k][2] +            h, x, y = HXY[k] -                H = abs(i - x) + abs(j - y) + h -                temp.append(H) +                temp = h + abs(x - i) + abs(y - j) +                if H > 0: +                    if H != temp: +                        break +                else: +                    H = temp -                border = min(border, abs(i - x) + abs(j - y)) -        temp = list(set(temp)) -        if len(temp) == 1 and temp[0] <= border: -            ans = [i, j, H] -print((*ans)) +                if H - abs(x - i) - abs(y - j) > 0: +                    break +        else: +            if H > 0: +                print((i, j, H))