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

object Main {
    def round(x:Double) = BigDecimal(x).setScale(3,BigDecimal.RoundingMode.HALF_UP).toDouble

    def main(args:Array[String]) = {
        val n = readInt
         for(i <- 0 until n) {
            val m = readLine.split(" ").map(_.toDouble)
            val (x12,y12,x13,y13) = (m(0)-m(2),m(1)-m(3),m(0)-m(4),m(1)-m(5))
            val (xx1,yy1,xx2,yy2,xx3,yy3) = (m(0)*m(0),m(1)*m(1),m(2)*m(2),m(3)*m(3),m(4)*m(4),m(5)*m(5))
            val g = 2*(x12*y13 - y12*x13)
            val x = (y13*(xx1 - xx2 + yy1 - yy2) - y12*(xx1 - xx3 + yy1 - yy3))/g
            val y = (x12*(xx1 - xx3 + yy1 - yy3) - x13*(xx1 - xx2 + yy1 - yy2))/g

            printf("%.3f %.3f %.3f\n",round(x),round(y),round(Math.sqrt(x*x+y*y)))
        }
    }
}