let n = Scanf.scanf " %d" (+) 0
let xyhs = Array.to_list @@ Array.init n @@ fun _ -> Scanf.scanf " %d %d %d" @@ fun a b c -> a, b, c
let f cx cy ch x y h = max 0 @@ ch - abs (x - cx) - abs (y - cy) = h
let xyh = List.find_opt (fun (_, _, h) -> h > 0) xyhs
let g cx cy = function None -> 1 | Some (x, y, h) -> h + abs (x - cx) + abs (y - cy)
let _ = for i = 0 to 100 do for j = 0 to 100 do let ch = g j i xyh in
  if List.for_all (fun (x, y, h) -> f j i ch x y h) xyhs then (Printf.printf "%d %d %d\n" j i ch; exit 0) done done