#!/usr/bin/ruby
include Math

class Float  
  def round(d=0)
    x = 10**d
    if self < 0
      (self * x - 0.5).ceil.quo(x)
    else
      (self * x + 0.5).floor.quo(x)
    end
  end
end

gets.to_i.times do
  b = false
  x, y = gets.split.map!{|f| f.to_f }.partition{ b = !b }

  a = [x[1] - x[0], x[2] - x[0]].map!{|i| i * 2}
  b = [y[1] - y[0], y[2] - y[0]].map!{|i| i * 2}
  c = [x[0] ** 2 - x[1] ** 2 + y[0] ** 2 - y[1] ** 2, 
       x[0] ** 2 - x[2] ** 2 + y[0] ** 2 - y[2] ** 2]
  
  p = [b[0] * c[1] - b[1] * c[0], c[0] * a[1] - c[1] * a[0]]     
  p.map! {|i| i / (a[0] * b[1] - a[1] * b[0]) }
  
  r = sqrt((p[0] - x[0]) ** 2 + (p[1] - y[0]) ** 2) 
  
  printf("%.3f %.3f %.3f", p[0].round(3), p[1].round(3), r.round(3))
  puts
end