#include <iostream>
#include <cmath>
#include <cstdio>

int main()
{
	int n;
	std::cin >> n;
	for(int i = 0; i < n; ++i)
	{
		double x1,y1,x2,y2,x3,y3;
		std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

		double const a = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));	
		double const b = sqrt((x3-x2)*(x3-x2) + (y3-y2)*(y3-y2));
		double const c = sqrt((x3-x1)*(x3-x1) + (y3-y1)*(y3-y1));

		double const cosA = (b*b+c*c-a*a)/(2*b*c);
		double const cosB = (a*a+c*c-b*b)/(2*a*c);
		double const cosC = (a*a+b*b-c*c)/(2*a*b);
		double const sinA = sqrt(1-cosA*cosA);

		double const r = a / (sinA * 2);
		//std::cout << "r = " << r << std::endl;

		//std::cout << "cosA = " << cosA << std::endl;
		//std::cout << "cosB = " << cosB << std::endl;
		//std::cout << "cosC = " << cosC << std::endl;

		if(-0.001 < cosA && cosA < 0.001) std::printf("%.3lf %.3lf", (x1+x2) / 2 , (y1+y2) / 2);
		else if (-0.001 < cosB && cosB < 0.001) std::printf("%.3lf %.3lf", (x2+x3) / 2 ,(y2+y3) / 2);
		else if (-0.001 < cosC && cosC < 0.001) std::printf("%.3lf %.3lf", (x1+x3) / 2 , (y1+y3) / 2);
		else
		{
			double const h = sqrt(r*r-(c/2)*(c/2));
				
			//std::cout << "c = " << c << std::endl;
			std::cout << "h = " << h << std::endl;
			
			double const xm = (x1+x3)/2;
			double const ym = (y1+y3)/2;
			std::cout << "xm = " << xm << " ym = " << ym << std::endl;

			double const sinD = (y1-y3) / sqrt((x3-x1)*(x3-x1) + (y3-y1)*(y3-y1));
			double const cosD = (x1-x3) / sqrt((x3-x1)*(x3-x1) + (y3-y1)*(y3-y1));
			std::cout << "sinD = " << sinD << " cosD = " << cosD << std::endl;

			double y4 = h * cosD;
			double x4 = h * sinD;
			std::cout << "x4 = " << x4 << " y4 = " << y4 << std::endl;

			if((sinD < 0 && cosD < 0) || (sinD > 0 && cosD < 0)) x4 *= -1;
			if((sinD == 0 && cosD < 0) || (sinD > 0 && cosD > 0) || (sinD < 0 && cosD > 0)) y4 *= -1;

			double const xd = xm + x4;
			double const yd = ym + y4;


			std::cout << xd << " " << yd;
		}
		std::printf(" %.3lf\n", r);
	}
	return 0;
}