#include<iostream>
#include<iomanip>
#include<cmath>

double sqr( double x )
{
	return x * x;
}

int main()
{
	int n;
	std::cin >> n;

	while( n-- )
	{
		double x1, y1, x2, y2, x3, y3;
		std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

		double a = x1 - x2, b = y1 - y2, c = -( sqr( x1 ) + sqr( y1 ) ) + ( sqr( x2 ) + sqr( y2 ) ),
			   d = x2 - x3, e = y2 - y3, f = -( sqr( x2 ) + sqr( y2 ) ) + ( sqr( x3 ) + sqr( y3 ) );

		double l = ( c * e - b * f ) / ( e * a - b * d ), m = ( c * d - a * f ) / ( b * d - a * e );
		double n = -( sqr( x1 ) + sqr( y1 ) + l * x1 + m * y1 );

		std::cout << std::fixed << std::setprecision( 3 );
		std::cout << -l / 2.0 << " " << -m / 2.0 << " " << sqrt( sqr( l ) + sqr( m ) - 4 * n ) / 2.0 << std::endl;
	}

	return 0;
}