//class Program
//{
//    static void Main()
//    {
//        double a = int.Parse(System.Console.In.ReadLine());
//        double b = 10;
//        double v = a*b/a;
//        System.Console.WriteLine(v);

//    }
//}

//using System;

//class Program
//{
//    static void Main()
//    {
//        Triangle saNkaku = new Triangle();
//        const int TRIAXIS = 6;
//        const int TRIANGLE = 3;
//        string[] line = new string[TRIAXIS];
//        double[] axis = new double[TRIAXIS];
//        double[] side = new double[TRIANGLE];
//        double centrx;
//        double centry;
//        int times = int.Parse(Console.ReadLine());
//        for (int i = 0; i < times; ++i)
//        {
//            line = Console.ReadLine().Split();
//            for (int j = 0; j < line.Length; ++j)
//            {
//                ///even axises are for x
//                axis[j] = double.Parse(line[j]);
//            }
//            side[0] = saNkaku.mkside(axis[0], axis[1], axis[2], axis[3]);
//            side[1] = saNkaku.mkside(axis[0], axis[1], axis[4], axis[5]);
//            side[2] = saNkaku.mkside(axis[2], axis[3], axis[4], axis[5]);
//            if (axis[0] == 0 && axis[1] == 0)
//            {
//                centrx = (axis[0] + axis[2] + axis[4]) / 6;
//                centry = (axis[1] + axis[3] + axis[5]) / 6;
//            }
//            else if (axis[0] == 0)
//            {
//                centrx = (axis[0] + axis[2] + axis[4]) / 6;
//                centry = (axis[1] + axis[3] + axis[5]) / (axis[1] * 6);
//            }
//            else if (axis[1] == 0)
//            {
//                centrx = (axis[0] + axis[2] + axis[4]) / (axis[0] * 6);
//                centry = (axis[1] + axis[3] + axis[5]) / 6;
//            }
//            else
//            {
//                centrx = (axis[0] + axis[2] + axis[4]) / (axis[0] * 6);
//                centry = (axis[1] + axis[3] + axis[5]) / (axis[1] * 6);
//            }
//            double Sq = saNkaku.Heron(side[0], side[1], side[2]);
//            double sides = side[0] * side[1] * side[2];
//            double rad = saNkaku.mkrad(sides, Sq);
//            // double CircX = saNkaku.mkcent(axis[0],centrx);
//            // double CircY = saNkaku.mkcent(axis[1],centry);
//            Console.WriteLine("{0:f3} {1:f3} {2:f3}", centrx, centry, rad);
//        }
//    }
//}
//class Triangle
//{
//    internal double mkside(double leftX, double leftY, double rightX, double rightY)
//    {
//        double x = Math.Abs(rightX - leftX);
//        double y = Math.Abs(rightY - leftY);
//        return Math.Sqrt(x * x + y * y);
//    }
//    internal double Heron(double a, double b, double c)
//    {
//        double s = (a + b + c) / 2;
//        return s * (s - a) * (s - b) * (s - c);
//    }
//    internal double mkrad(double abc, double S)
//    {
//        return abc / (2 * S);
//    }
//    internal double mkcent(double start, double centrsum)
//    {
//        return centrsum / 2;
//    }
//}

using System;

class Program
{
    static void Main()
    {
        Triangle tri = new Triangle();
        int n = int.Parse(Console.ReadLine());
        for (int i = 0; i < n; i++)
        {
            string[] s1 = Console.ReadLine().Split(' ');
            double x1 = double.Parse(s1[0]);
            double y1 = double.Parse(s1[1]);
            double x2 = double.Parse(s1[2]);
            double y2 = double.Parse(s1[3]);
            double x3 = double.Parse(s1[4]);
            double y3 = double.Parse(s1[5]);
            double x12 = x1 - x2;
            double y12 = y1 - y2;
            double x23 = x2 - x3;
            double y23 = y2 - y3;
            double x31 = x3 - x1;
            double y31 = y3 - y1;
            double a = tri.MkSide(x12, y12);
            double b = tri.MkSide(x23, y23);
            double c = tri.MkSide(x31, y31);
            double r = tri.Mkradius(a, b, c);
            double x = (((tri.side(x1,y1,y23)) + (tri.side(x2,y2,y31)) + (tri.side(x3,y3,y12))) / ((x1 * y23) + (x2 * y31) + (x3 * y12))) / 2;
            double y = (((tri.side(x1,y1,x23)) + (tri.side(x2,y2,x31)) + (tri.side(x3,y3,x12))) / ((y1 * x23) + (y2 * x31) + (y3 * x12))) / 2;
            Console.WriteLine("{0:F3} {1:F3} {2:F3}", x, y, r);
        }
    }
}
class Triangle
{
    internal double MkSide(double x, double y)
    {
        return Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2));
    }
    internal double Mkradius(double a, double b, double c)
    {
        return (a * b * c) / Math.Sqrt((a + b + c) * (-a + b + c) * (a - b + c) * (a + b - c));
    }
    internal double side(double x, double y, double side1)
    {
        return (Math.Pow(x, 2) + Math.Pow(y, 2)) * side1;
    }
}


Measured memory_bytes: 15876