local mmi, mma = math.min, math.max
local mab = math.abs
local n = io.read("*n")
local x, y, h = {}, {}, {}
for i = 1, n do
  x[i], y[i], h[i] = io.read("*n", "*n", "*n")
end
for xi = 0, 100 do
  for yi = 0, 100 do
    local hmin, hmax = 1, 1000000000
    for i = 1, n do
      if 0 < h[i] then
        local v = mab(xi - x[i]) + mab(yi - y[i]) + h[i]
        hmax = mmi(hmax, v)
        hmin = mma(hmin, v)
      else
        local v = mab(xi - x[i]) + mab(yi - y[i])
        hmax = mmi(hmax, v)
      end
    end
    if hmin == hmax then
      print(xi .. " " .. yi .. " " .. hmin)
      os.exit()
    end
  end
end
