import Control.Monad
import Data.List
import Data.Maybe

main = do
    n<-readLn::IO Int
    xyhs<-filter(\(_:_:h:_)->h>0) <$> replicateM n (map read.words<$>getLine) ::IO [[Int]]
    let Just (Just h,(x,y)) = find (\(h,_)->isJust h) $ map (f xyhs) [(cx,cy)|cx<-[0..100],cy<-[0..100]]
    putStrLn $ unwords $ map show [x,y,h]
--
f xyhs (cx,cy) = (chk $ map (g cx cy) xyhs, (cx,cy))
g cx cy (x:y:h:_) = h+ abs(x-cx)+ abs(y-cy)

chk [h] = Just h

chk (a:b:hs)
    | a==b = chk (b:hs)
    | otherwise = Nothing
