let tuple s =
  let split = Str.split (Str.regexp_string " ") in
  let nth = split s |> List.map float_of_string |> List.nth in
  (nth 0,nth 1,nth 2,nth 3,nth 4,nth 5);;

let () =
  let n = read_int () in
  let rec loop = function
      0 -> ()
    | i -> let (x1,y1,x2,y2,x3,y3) = read_line () |> tuple in
           let a = 2.*.(x1-.x2) and
               b = 2.*.(y1-.y2) and
               c = 2.*.(x1-.x3) and
               d = 2.*.(y1-.y3) and
               e = x1*.x1 -. x2*.x2 +. y1*.y1 -. y2*.y2 and
               f = x1*.x1 -. x3*.x3 +. y1*.y1 -. y3*.y3 in
           let g = a*.d -. b*.c in
           let x = (e*.d -. b*.f)/.g and
               y = (a*.f -. e*.c)/.g 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