import Math._
object Main extends App {
  val n = readLine().toInt

  for (i <- 0 until n) {
    val Seq(x1, y1, x2, y2, x3, y3) = readLine().split(' ').map(_.toDouble).toList
    val l1 = pow(x2 - x3, 2) + pow(y2 - y3, 2)
    val l2 = pow(x3 - x1, 2) + pow(y3 - y1, 2)
    val l3 = pow(x1 - x2, 2) + pow(y1 - y2, 2)

    val G1 = l1*(l2 + l3 - l1)
    val G2 = l2*(l3 + l1 - l2)
    val G3 = l3*(l1 + l2 - l3)

    val px = (G1 * x1 + G2 * x2 + G3 * x3) / (G1 + G2 + G3)
    val py = (G1 * y1 + G2 * y2 + G3 * y3) / (G1 + G2 + G3)

    val u1 = sqrt(l1)
    val u2 = sqrt(l2)
    val u3 = sqrt(l3)

    val r = (u1 * u2 * u3) / sqrt((u1 + u2 + u3) * (-u1 + u2 + u3) * (u1 - u2 + u3) * (u1 + u2 - u3))

    println("%.3f %.3f %.3f".format(px, py, r))
  }
}
