gets.to_i.times {
  x1, y1, x2, y2, x3, y3 = gets.split.map &:to_f
  ax = x1 - x2
  ay = y1 - y2
  bx = x3 - x1
  by = y3 - y1
  sum = x1 * x1 + y1 * y1
  c1 = sum - x2 * x2 - y2 * y2
  c2 = sum - x3 * x3 - y3 * y3
  z = (ax * by - ay * bx) * 2
  px = (c1 * by + c2 * ay) / z
  py = -(c2 * ax + c1 * bx) / z
  r = ((px - x1)**2 + (py - y1)**2) ** 0.5
  puts sprintf("%.3f %.3f %.3f", px, py, r)
}