#include <iostream>
#include <cmath>

int main()
{
        int n;
        double x1, x2, x3, y1, y2, y3, a, b, c, r;
        std::cin >> n;
        std::cout.precision(3);
        std::cout.setf(std::ios::fixed);
        while(n--)
        {
                std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
                a = (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2);
                b = (x1 - x3)*(x1 - x3) + (y1 - y3)*(y1 - y3);
                c = (x2 - x3)*(x2 - x3) + (y2 - y3)*(y2 - y3);
                r = -(a*a + b*b + c*c - 2*a*b - 2*b*c - 2*c*a);
                std::cout << (a*(-a+b+c)*x1 + b*(a-b+c)*x2 + c*(a+b-c)*x3)/r << " " << (a*(-a+b+c)*y1 + b*(a-b+c)*y2 + c*(a+b-c)*y3)/r << " " << sqrt(a*b*c/r) << std::endl;
        }
        return 0;
}