n = int(eval(input()))



x = []

y = []

h = []

for i in range(n):

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

    x.append(xi)

    y.append(yi)

    h.append(hi)



isOk = False

i = 0

j = 0

constant = -1



for i in range(101):

    for j in range(101):



        constant = -1

        for k in range(n):

            if h[k] != 0:

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



                if constant == -1:

                    constant = temp



                if constant != temp:

                    break

        else:



            for p in range(n):

                if h[p] == 0 and constant - abs(i - x[p]) - abs(j - y[p]) > 0:

                    break

            else:

                isOk = True

                break

        

    if isOk:

        break



print((i, j, constant))

        
n = int(eval(input()))



xyh = []



for i in range(n):

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



isOk = False

i = 0

j = 0

constant = -1



for i in range(101):

    for j in range(101):



        constant = -1

        for xyhTemp in xyh:

            if xyhTemp[2] != 0:

                temp = xyhTemp[2] + abs(i - xyhTemp[0]) + abs(j - xyhTemp[1])



                if constant == -1:

                    constant = temp



                if constant != temp:

                    break

        else:



            for p in xyh:

                if p[2] == 0 and constant - abs(i - p[0]) - abs(j - p[1]) > 0:

                    break

            else:

                isOk = True

                break

        

    if isOk:

        break



print((i, j, constant))

        

n = int(eval(input()))
x = []
y = []
h = []
for i in range(n):
    xi, yi, hi = list(map(int, input().split()))
    x.append(xi)
    y.append(yi)
    h.append(hi)
isOk = False
i = 0
j = 0
constant = -1
for i in range(101):
    for j in range(101):
        constant = -1
        for k in range(n):
            if h[k] != 0:
                temp = h[k] + abs(i - x[k]) + abs(j - y[k])
                if constant == -1:
                    constant = temp
                if constant != temp:
                    break
        else:
            for p in range(n):
                if h[p] == 0 and constant - abs(i - x[p]) - abs(j - y[p]) > 0:
                    break
            else:
                isOk = True
                break
    if isOk:
        break
print((i, j, constant))

n = int(eval(input()))
xyh = []
for i in range(n):
    xyh.append(list(map(int, input().split())))
isOk = False
i = 0
j = 0
constant = -1
for i in range(101):
    for j in range(101):
        constant = -1
        for xyhTemp in xyh:
            if xyhTemp[2] != 0:
                temp = xyhTemp[2] + abs(i - xyhTemp[0]) + abs(j - xyhTemp[1])
                if constant == -1:
                    constant = temp
                if constant != temp:
                    break
        else:
            for p in xyh:
                if p[2] == 0 and constant - abs(i - p[0]) - abs(j - p[1]) > 0:
                    break
            else:
                isOk = True
                break
    if isOk:
        break
print((i, j, constant))

-x = [] -y = [] -h = [] +xyh = [] -    xi, yi, hi = list(map(int, input().split())) -    x.append(xi) -    y.append(yi) -    h.append(hi) +    xyh.append(list(map(int, input().split()))) -        for k in range(n): -            if h[k] != 0: -                temp = h[k] + abs(i - x[k]) + abs(j - y[k]) +        for xyhTemp in xyh: +            if xyhTemp[2] != 0: +                temp = xyhTemp[2] + abs(i - xyhTemp[0]) + abs(j - xyhTemp[1]) -            for p in range(n): -                if h[p] == 0 and constant - abs(i - x[p]) - abs(j - y[p]) > 0: +            for p in xyh: +                if p[2] == 0 and constant - abs(i - p[0]) - abs(j - p[1]) > 0: