N = int(eval(input()))

lis = []

for _ in range(N):

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

    if h > 0:

        sx, sy, sh = x, y, h

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

for i in range(101):

    for j in range(101):

        high = sh + abs(sx - i) + abs(sy - j)

        judge = -1

        for x, y, h in lis:

            if h > 0 and high != h + abs(x - i) + abs(y - j):

                judge = 0

                break

        if judge == 0:

            continue

        for x, y, h in lis:

            if h == 0 and high > abs(x - i) + abs(y - j):

                judge = 0

                break

        if judge == 0:

            continue

        

        print((i, j, sh + abs(sx - i) + abs(sy - j)))

        exit()
N = int(eval(input()))

lis = []

for _ in range(N):

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

    if h > 0:

        sx, sy, sh = x, y, h

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

for i in range(101):

    for j in range(101):

        high = sh + abs(sx - i) + abs(sy - j)

        judge = True

        for x, y, h in lis:

            if h > 0 and high != h + abs(x - i) + abs(y - j):

                judge = False

                break

            if h == 0 and high > abs(x - i) + abs(y - j):

                judge = False

                break

        if judge:

            print((i, j, sh + abs(sx - i) + abs(sy - j)))

            exit()
N = int(eval(input()))
lis = []
for _ in range(N):
    x, y, h = list(map(int, input().split()))
    if h > 0:
        sx, sy, sh = x, y, h
    lis.append((x, y, h))
for i in range(101):
    for j in range(101):
        high = sh + abs(sx - i) + abs(sy - j)
        judge = -1
        for x, y, h in lis:
            if h > 0 and high != h + abs(x - i) + abs(y - j):
                judge = 0
                break
        if judge == 0:
            continue
        for x, y, h in lis:
            if h == 0 and high > abs(x - i) + abs(y - j):
                judge = 0
                break
        if judge == 0:
            continue
        print((i, j, sh + abs(sx - i) + abs(sy - j)))
        exit()

N = int(eval(input()))
lis = []
for _ in range(N):
    x, y, h = list(map(int, input().split()))
    if h > 0:
        sx, sy, sh = x, y, h
    lis.append((x, y, h))
for i in range(101):
    for j in range(101):
        high = sh + abs(sx - i) + abs(sy - j)
        judge = True
        for x, y, h in lis:
            if h > 0 and high != h + abs(x - i) + abs(y - j):
                judge = False
                break
            if h == 0 and high > abs(x - i) + abs(y - j):
                judge = False
                break
        if judge:
            print((i, j, sh + abs(sx - i) + abs(sy - j)))
            exit()

-        judge = -1 +        judge = True -                judge = 0 +                judge = False -        if judge == 0: -            continue -        for x, y, h in lis: -                judge = 0 +                judge = False -        if judge == 0: -            continue -        print((i, j, sh + abs(sx - i) + abs(sy - j))) -        exit() +        if judge: +            print((i, j, sh + abs(sx - i) + abs(sy - j))) +            exit()