Scanf.scanf "%d\n" (fun n->
  let rec loop i (mx,my,xx,xy)=
    if i=n then (mx,my,xx,xy) else
    let m = Scanf.scanf "%d %d %d\n" (fun x1 y1 h1->
            if h1<=0 then (mx,my,xx,xy) else
            (min mx (x1-h1),min my (y1-h1),max xx (x1+h1),max xy (y1+h1))
    ) in
    loop (i+1) m
  in
  let (mx,my,xx,xy) = loop 0 (0,0,0,0) in
  let x = (xx-mx)/2 in
  let y = (xy-my)/2 in
  Printf.printf "%d %d %d\n" ((xx+mx)/2) ((xy+my)/2) (max x y)

)
