import sys

input = sys.stdin.readline

def solve():

  n = int(eval(input()))

  query = []

  candi = []

  for i in range(n):

    x,y,h = (int(i) for i in input().split())

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

  if n == 1:

    print((*[x,y,h]))

    exit()

  for cx in range(0,101):

    for cy in range(0,101):

      judge = True

      for j in range(n):

        x,y,h = query[j]

        if not h == 0:

          karih = h +abs(cx-x)+abs(cy-y)

          karih2 = 0

      for i in range(n):

        nx,ny,nh = query[i]

        if nh == max(karih-abs(nx-cx)-abs(ny-cy),0):

          pass

        else:

          judge = False

      if judge:

        candi.append((cx,cy,karih))

        

      judge = True 

      for i in range(n-1):

        nx,ny,nh = query[i+1]

        if nh == max(karih2-abs(nx-cx)-abs(ny-cy),0):

          pass

        else:

          judge = False

      if judge:

        candi.append((cx,cy,karih2))

  print((*candi[0]))

        

          

      

      

solve()
import sys

input = sys.stdin.readline

def solve():

  n = int(eval(input()))

  query = []

  candi = []

  for i in range(n):

    x,y,h = (int(i) for i in input().split())

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

  if n == 1:

    print((*[x,y,h]))

    exit()

  query = sorted(query,reverse = True,key=lambda x: x[2])

  for cx in range(0,101):

    for cy in range(0,101):

      judge = True

      x,y,h = query[0]

      karih = h +abs(cx-x)+abs(cy-y)

      karih2 = 0

      for i in range(n-1):

        nx,ny,nh = query[i+1]

        if nh == max(karih-abs(nx-cx)-abs(ny-cy),0):

          pass

        else:

          judge = False

      if judge:

        candi.append((cx,cy,karih))

        

  print((*candi[0]))

        

          

      

      

solve()
import sys

input = sys.stdin.readline


def solve():
    n = int(eval(input()))
    query = []
    candi = []
    for i in range(n):
        x, y, h = (int(i) for i in input().split())
        query.append((x, y, h))
    if n == 1:
        print((*[x, y, h]))
        exit()
    for cx in range(0, 101):
        for cy in range(0, 101):
            judge = True
            for j in range(n):
                x, y, h = query[j]
                if not h == 0:
                    karih = h + abs(cx - x) + abs(cy - y)
                    karih2 = 0
            for i in range(n):
                nx, ny, nh = query[i]
                if nh == max(karih - abs(nx - cx) - abs(ny - cy), 0):
                    pass
                else:
                    judge = False
            if judge:
                candi.append((cx, cy, karih))
            judge = True
            for i in range(n - 1):
                nx, ny, nh = query[i + 1]
                if nh == max(karih2 - abs(nx - cx) - abs(ny - cy), 0):
                    pass
                else:
                    judge = False
            if judge:
                candi.append((cx, cy, karih2))
    print((*candi[0]))


solve()

import sys

input = sys.stdin.readline


def solve():
    n = int(eval(input()))
    query = []
    candi = []
    for i in range(n):
        x, y, h = (int(i) for i in input().split())
        query.append((x, y, h))
    if n == 1:
        print((*[x, y, h]))
        exit()
    query = sorted(query, reverse=True, key=lambda x: x[2])
    for cx in range(0, 101):
        for cy in range(0, 101):
            judge = True
            x, y, h = query[0]
            karih = h + abs(cx - x) + abs(cy - y)
            karih2 = 0
            for i in range(n - 1):
                nx, ny, nh = query[i + 1]
                if nh == max(karih - abs(nx - cx) - abs(ny - cy), 0):
                    pass
                else:
                    judge = False
            if judge:
                candi.append((cx, cy, karih))
    print((*candi[0]))


solve()

+    query = sorted(query, reverse=True, key=lambda x: x[2]) -            for j in range(n): -                x, y, h = query[j] -                if not h == 0: -                    karih = h + abs(cx - x) + abs(cy - y) -                    karih2 = 0 -            for i in range(n): -                nx, ny, nh = query[i] +            x, y, h = query[0] +            karih = h + abs(cx - x) + abs(cy - y) +            karih2 = 0 +            for i in range(n - 1): +                nx, ny, nh = query[i + 1] -            judge = True -            for i in range(n - 1): -                nx, ny, nh = query[i + 1] -                if nh == max(karih2 - abs(nx - cx) - abs(ny - cy), 0): -                    pass -                else: -                    judge = False -            if judge: -                candi.append((cx, cy, karih2))