(defn formula [X Y x y]
  (+ (Math/abs (- X x)) (Math/abs (- Y y))))
(defn get-height [X Y [x y h]]
  (+ (formula X Y x y) h))

(defn zero-case [X Y zs]
  (apply min (map (fn[[x y h]](formula X Y x y)) zs)))

(defn Pyramid [ls]
  (let [{lsn false zs true} (group-by (fn [[x y h]] (zero? h)) ls)]
    (first
      (for [X (range 0 101)
            Y (range 0 101)
            :let [Hs (map #(get-height X Y %) lsn)
                  H (first Hs)]
            :when (and (apply = Hs)
                    (if (nil? zs)
                      true
                      (>= (zero-case X Y zs) H)))]
        (format "%d %d %d" X Y H)))))

(defn input [N]
  (when-not (zero? N)
    (let [x (int (read)) y (int (read)) h (int (read))]
      (cons [x y h] (input (dec N))))))

(-> (read) int input Pyramid println)