n = gets.to_i

n.times do
  ax, ay, bx, by, cx, cy = gets.split.map(&:to_f)
  a1 = 2 * (bx - ax)
  b1 = 2 * (by - ay)
  c1 = ax * ax - bx * bx + ay * ay - by * by
  a2 = 2 * (cx - ax)
  b2 = 2 * (cy - ay)
  c2 = ax * ax - cx * cx + ay * ay - cy * cy;

  px = (b1 * c2 - b2 * c1) / (a1 * b2 - a2 * b1)
  py = (c1 * a2 - c2 * a1) / (a1 * b2 - a2 * b1)

  r = Math.sqrt((px - ax) * (px - ax) + (py - ay) * (py - ay))

  printf "%.3f %.3f %.3f\n", px, py, r
end
