
import Data.List (partition, foldl')

mk [x,y,z] = (x,y,z)

a#b = abs (a-b)

solv :: [(Int,Int,Int)] -> [(Int,Int,Int)]
solv xs
  = foldl' lt (foldl' eq [(cx,cy,h0+x0#cx+y0#cy)|cx<-[0..100], cy<-[0..100]] nzs) zs
  where
    eq :: [(Int,Int,Int)] -> (Int,Int,Int) -> [(Int,Int,Int)]
    eq xs' (x,y,h) = filter (\(cx,cy,ch)->ch==h + x#cx + y#cy) xs'
    lt :: [(Int,Int,Int)] -> (Int,Int,Int) -> [(Int,Int,Int)]
    lt xs' (x,y,h) = filter (\(cx,cy,ch)->ch<=x#cx + y#cy) xs'
    (nzs@((x0,y0,h0):_), zs) = partition (\(_,_,h)-> h>0) xs

main = do
  getLine
  ps <- map (mk.map read.words) . lines <$> getContents :: IO [(Int,Int,Int)]
  let (x,y,h):_ = solv ps
  putStrLn . unwords . map show $ [x,y,h]
