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

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

chk [h] = Just h

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