(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)
    (let[x (int(read)) y (int(read)) h (int(read))]
      (if-not(zero? h)
        (cons [x y h] (input (dec N)))
        (input (dec N))))))

(-> (read) int input Pyramid println)