/**
  * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0010
  * Circumscribed Circle of a Triangle
  */
object Main {
  def main(args: Array[String]): Unit = {
    val n = io.StdIn.readInt()
    Iterator.continually(io.StdIn.readLine()).takeWhile(_ != null).take(n).map(_.split(" +").map(BigDecimal(_)))
      .map { case Array(x1, y1, x2, y2, x3, y3) => solve(x1, y1, x2, y2, x3, y3) }
      .foreach { case (px, py, r) =>
        println(s"${px.setScale(3, BigDecimal.RoundingMode.HALF_UP)} ${py.setScale(3, BigDecimal.RoundingMode.HALF_UP)} ${r.setScale(3, BigDecimal.RoundingMode.HALF_UP)}")
      }
  }

  def solve(x1: BigDecimal, y1: BigDecimal, x2: BigDecimal, y2: BigDecimal, x3: BigDecimal, y3: BigDecimal): (BigDecimal, BigDecimal, BigDecimal) = {
    val px = ((y1 - y2) * ((x1 + x3) * (x1 - x3) + (y1 + y3) * (y1 - y3)) - (y1 - y3) * ((x1 + x2) * (x1 - x2) + (y1 + y2) * (y1 - y2))) / (2 * ((x1 - x3) * (y1 - y2) - (x1 - x2) * (y1 - y3)))
    val py = ((x1 - x2) * ((y1 + y3) * (y1 - y3) + (x1 + x3) * (x1 - x3)) - (x1 - x3) * ((y1 + y2) * (y1 - y2) + (x1 + x2) * (x1 - x2))) / (2 * ((y1 - y3) * (x1 - x2) - (y1 - y2) * (x1 - x3)))
    val r = BigDecimal(math.sqrt(math.pow((x1 - px).toDouble, 2) + math.pow((y1 - py).toDouble, 2)))
    (px, py, r)
  }
}