{-# LANGUAGE BangPatterns -#}

import Control.Monad

main :: IO ()
main = do
  n <- readLn
  xyhs <- replicateM n $ map read . words <$> getLine
  putStrLn $ unwords $ map show $ solve xyhs

solve :: [[Int]] -> [Int]
solve xyhs = go acc0 xyhs
  where
    acc0 = [ [cx, cy, ch] | cx <- [0 .. 100], cy <- [0 .. 100], ch <- [ch0 - 200 .. ch0 + 200] ]
    ch0 = head $ map last xyhs

    go !acc [] = head acc
    go !acc (xyh:xyhs) = go (step xyh acc) xyhs

    step [x, y, h] acc = filter (\[cx, cy, ch] -> h == max (ch - abs (x - cx) - abs (y - cy)) 0) acc