#include<iostream>
#include<iomanip>
#include<math.h>

using namespace std;

bool get_snb( double , double , double , double , double& , double& );
double get_distance( double , double , double , double );

int main(void)
{
	double x1, x2, x3;
	double y1, y2, y3;

	double a[3] , b[3];

	double px, py;
	double r;

	int n;

	cin >> n;

	for( int k = 0 ; k < n ; k++ )
	{
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

		int i = 0;
		while(1)
		{
			if( get_snb( x1 , x2 , y1 , y2 , a[i] , b[i] ) == true ) i++;
			if( get_snb( x1 , x3 , y1 , y3 , a[i] , b[i] ) == true )
			{
				i++;
				if( i == 2 ) break;

			}
			if( get_snb( x2 , x3 , y2 , y3 , a[i] , b[i] ) == true )
			{
				i++;
				if( i == 2 ) break;
			}
		}

	
		px = -( b[0] - b[1] )/( a[0] - a[1] );
		py = a[0] * px + b[0];
	
		r = get_distance( x1 , px , y1 , py );

		cout.setf( ios::fixed , ios::floatfield );
		cout<< setprecision(3) << px << " " << py << " " << r << endl;
	}

	return 0;


}

bool get_snb( double x1 , double x2 , double y1 , double y2 , double& a , double& b )
{
	double cx, cy;
	a = -( x1 - x2 )/( y1 - y2 );

	if( y1 - y2 <= 0.0001 && y1 - y2 >= -0.0001 ) return false;
	if( x1 - x2 <= 0.0001 && x1 - x2 >= -0.0001 ) a = 0;
	
	cx = ( x1 + x2 ) / 2;
	cy = ( y1 + y2 ) / 2;

	b = cy - a * cx;

	return true;
}

double get_distance( double x1 , double x2 , double y1 , double y2 )
{
	return sqrt( (x1-x2) * (x1-x2) + (y1-y2) * (y1-y2) );
}