let g n m = 2. *. (n -. m);;
let h a b c d = a *. a -. b *. b +. c *. c -. d *. d;;
let () =
  let n = read_int () in (* nを読み込む *)
  let rec loop = function
    | 0 -> () (* 正常終了 *)
    | i -> let (x1, y1, x2, y2, x3, y3) = Scanf.scanf "%f %f %f %f %f %f\n" (fun a b c d e f -> (a, b, c, d, e, f)) in
      let (a, b, c, d, e, f) =
        (g x1 x2, g y1 y2, g x1 x3, g y1 y3, h x1 x2 y1 y2, h x1 x3 y1 y3) in
      let j = a *. d -. b *. c in
      let (x, y) = ((e *. d -. b *. f) /. j, (a *. f -. e *. c) /. j) in
      let r = sqrt ((x -. x1) ** 2. +. (y -. y1) ** 2.) in
      Printf.printf "%.3f %.3f %.3f\n" x y r; loop (i-1)
  in loop n
