#include <iostream>
#include <iomanip>
#include <algorithm>
#include <math.h>
using namespace std;
int main( void )
{
	int n;
	cin >> n;
	for ( int i = 0; i < n; i++ )
	{
		double x1, y1, x2, y2, x3, y3;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

		for ( int j = 0; j < 3; j++ )
		{
			swap( x1, x2 );
			swap( y1, y2 );
			swap( x2, x3 );
			swap( y2, y3 );

			double a = 2.0 * x1 - 2.0 * x2;
			double b = 2.0 * y1 - 2.0 * y2;
			double c = 2.0 * x2 - 2.0 * x3;
			double d = 2.0 * y2 - 2.0 * y3;

			if ( a * b - c * d == 0.0 )
				continue;

			double e = x1 * x1 - x2 * x2 + y1 * y1 + y2 * y2;
			double f = x2 * x2 - x3 * x3 + y2 * y2 + y3 * y3;

			double x0 = ( d * e - b * f ) / ( a * b - c * d );
			double y0 = ( a * f - c * e ) / ( a * b - c * d );

			double r1 = sqrt( (x1-x0)*(x1-x0) + (y1-y0)*(y1-y0) );
			double r2 = sqrt( (x2-x0)*(x2-x0) + (y2-y0)*(y2-y0) );
			double r3 = sqrt( (x3-x0)*(x3-x0) + (y3-y0)*(y3-y0) );

			cout.setf( ios::fixed, ios::floatfield );
			cout << setprecision(3);
			if ( r1 == r2 && r1 == r3 )
				cout << x0 << " " << y0 << " " << r1 << endl;
		}

	}
	return 0;
}