import Control.Monad
import Text.Printf

height :: Int -> Int -> [[Int]] -> Int
height cx cy ps = if (all (\[x, y, h] -> h == (max 0 (ch - (abs (cx - x)) - (abs (cy - y))))) ps) then ch else 0
  where
    [x0, y0, h0]:_ = filter (\[x, y, h] -> h > 0) ps
    ch = h0 + (abs (cx - x0)) + (abs (cy - y0))

solve :: [[Int]] -> (Int, Int, Int)
solve ps = t
  where
    t:_ = filter (\(x, y, h) -> h > 0) [(cx, cy, height cx cy ps) | cx <- [0 .. 100], cy <- [0 .. 100]]


main :: IO ()
main = do
  n <- readLn :: IO Int
  ps <- replicateM n $ (map (\s -> read s :: Int)) . words <$> getLine
  let (cx, cy, ch) = solve ps in
    printf "%d %d %d\n" cx cy ch
