(defn MiniPyramid [X Y [x y h]]
  (+ (Math/abs (- X x)) (Math/abs (- Y y)) h))
              
(defn Pyramid [ls]
  (first
    (for[ X (range 0 101) 
          Y (range 0 101)
          :let [Hs (map #(MiniPyramid X Y %) ls)]
          :when (apply = Hs)]
      (format "%d %d %d" X Y (first Hs)))))

(defn input[N]
  (when-not (zero? N)
    (cons [(int(read)) (int(read)) (int(read))]      
      (input (dec N)))))
(-> (read) int input Pyramid println)