#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <cfloat>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>

using namespace std;

typedef unsigned int UI;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef istringstream ISS;
typedef ostringstream OSS;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define EACH( v, c ) for ( auto &v : c )

#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 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

#include <complex>

typedef complex<double> Point;

const double EPS = 1e-9;

bool eq( double a, double b )
{
	return abs( a - b ) < EPS;
}

bool eq( Point a, Point b )
{
	return eq( a.real(), b.real() ) && eq( a.imag(), b.imag() );
}

double getRadius( double a, double b, double c )
{
	return ( a * b * c ) / sqrt( ( a + b + c ) * ( -a + b + c ) * ( a - b + c ) * ( a + b - c ) );
}

void solve( Point a, Point b, Point c )
{
	double ab = abs( a - b );

	Point unit_ab = ( b - a ) / ab;
	Point mid_ab = Point( ( b - a ).real() / 2, ( b - a ).imag() / 2 );
	Point norm_ab1 = Point( -( unit_ab.imag() ), unit_ab.real() ), norm_ab2 = Point( unit_ab.imag(), -( unit_ab.real() ) );

	double r = getRadius( abs( a - b ), abs( b - c ), abs( c - a ) );
	double t = sqrt( pow( r, 2 ) - pow( ab / 2, 2 ) );

	Point o1 = mid_ab + norm_ab1 * t, o2 = mid_ab + norm_ab2 * t;

	if ( !eq( abs( o1 - c ), r ) )
	{
		swap( o1, o2 );
	}

	cout << o1.real() << ' ' << o1.imag() << ' ' << r << endl;

	return;
}

int main()
{
	cin.tie( 0 );
	ios::sync_with_stdio( false );

	cout.precision( 3 );
	cout << fixed;

	int n;
	cin >> n;

	REP( i, 0, n )
	{
		double a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;

		solve( Point( a, b ), Point( c, d ), Point( e, f ) );
	}

	return 0;
}