n = int(eval(input()))



xyh = [None] * n 



for i in range(n):

    xyh[i] = 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()))



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



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()))
xyh = [None] * n
for i in range(n):
    xyh[i] = 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()))
xyh = [list(map(int, input().split())) for _ in range(n)]
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))

-xyh = [None] * n -for i in range(n): -    xyh[i] = list(map(int, input().split())) +xyh = [list(map(int, input().split())) for _ in range(n)]