#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef long long ll;
typedef unsigned long long ull;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); i++ )
#define UREP( i, m, n ) for ( unsigned int i = (unsigned int)( m ); i < (unsigned int)( n ); i++ )

#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define RALL( c ) (c).rbegin(), (c).rend()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

double sqdist( double x1, double y1, double x2, double y2 )
{
	return pow( x1 - x2, 2 ) + pow( y1 - y2, 2 );
}

double dist( double x1, double y1, double x2, double y2 )
{
	return sqrt( sqdist( x1, y1, x2, y2 ) );
}

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

	REP( dn, 0, n )
	{
		double x1, y1, x2, y2, x3, y3;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

		double mx = ( x1 + x2 ) / 2, my = ( y1 + y2 ) / 2;
		double a = -( ( x2 - x1 ) / ( y2 - y1 ) );
		double th = atan( a );

		double low = -100.0, high = 100.0, mid = 0;

		REP( i, 0, 1000 )
		{
			mid = ( low + high ) / 2;
			double cx = mx + cos( th ) * mid, cy = my + sin( th ) * mid;

			double d1 = sqdist( x1, y1, cx, cy ), d2 = sqdist( cx, cy, x3, y3 );

			if ( d1 < d2 )
			{
				high = mid;
			}
			else if ( d2 < d1 )
			{
				low = mid;
			}
		}

		double rx = mx + cos( th ) * mid, ry = my + sin( th ) * mid;

		cout.precision( 4 );
		cout << setiosflags( ios::showpoint ) << rx << ' ' << ry << ' ' << dist( x1, x2, rx, ry ) << endl;
	}

	return 0;
}