def solver(a, b, c, d, e, f)
  if a * b * d * e != 0
    return ((c - f * (b / e)) / (a - d * (b / e))), ((c - f * (a / d)) / (b - e * (a / d)))
  else
    if a == 0
      return ((f - e * (c / b)) / d), (c / b)
    elsif b == 0
      return (c / a), ((f - d * (c / a)) / e)
    elsif d == 0
      return ((c - b * (f / e)) / a), (f / e)
    else
      return (f / d), ((c - a * (f / d)) / b)
    end
  end
end

gets.to_i.times do
  a, b, c, d, e, f = gets.split(" ").map(&:to_f)
  x, y = solver(c - a, d - b, (c ** 2 - a **2 + d ** 2 - b ** 2) / 2, c - e,d - f, (c ** 2 - e ** 2 + d ** 2 - f ** 2) / 2)
  puts [sprintf("%.3f", x), sprintf("%.3f", y), sprintf("%.3f", ((x - a) ** 2 + (y - b) ** 2) ** 0.5)].join(" ")
end