import scala.io.StdIn.{readInt,readLine}

object Main {
        def main(args:Array[String]) = {
                val n = readInt
                for(i <- 0 until n) {
                        val p = readLine.split(" ").map(_.toDouble)
                        val (xa,ya) = (0,0)
            val (xb,yb) = (p(2)-p(0),p(3)-p(1))
            val (xc,yc) = (p(4)-p(0),p(5)-p(1))
            val d = 2*(xb*yc-yb*xc)
            val x = (yc*(xb*xb+yb*yb) - yb*(xc*xc+yc*yc))/d
            val y = (xb*(xc*xc+yc*yc) - xc*(xb*xb+yb*yb))/d
            printf("%0.3f %0.3f %0.3f",x,y,Math.sqrt(x*x+y*y))

                 }
        }
}