#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

inline sqr(double x){return x*x;}
inline double Roundoff(double x){
	if( x<0 ){
		x*=-1;
		x=(x-(x-int(x*1000)/1000))+(((x*1000)-int(x*1000))*10)>=4?0.001:0;
		x*=-1;
	}else{
		x=(x-(x-int(x*1000)/1000))+(((x*1000)-int(x*1000))*10)>=4?0.001:0;
	}
	return x;
}

void SolveSimultEq(double &x,double &y,double a,double b,double c,double d,double e,double f);
int main(){
	int datanum;
	double *x1,*y1,*x2,*y2,*x3,*y3;
	cin>>datanum;
	x1=new double[datanum];
	y1=new double[datanum];
	x2=new double[datanum];
	y2=new double[datanum];
	x3=new double[datanum];
	y3=new double[datanum];
	
	for( int i=0;i<datanum;i++ ){
		cin>>x1[i]>>y1[i]>>x2[i]>>y2[i]>>x3[i]>>y3[i];
	}
	for( int i=0;i<datanum;i++ ){
		double px,py,r;
		
		SolveSimultEq(px,py,2*(x1[i]-x2[i]),2*(y1[i]-y2[i]),sqr(x1[i])-sqr(x2[i])+sqr(y1[i])-sqr(y2[i]),
  			  	    2*(x2[i]-x3[i]),2*(y2[i]-y3[i]),sqr(x2[i])-sqr(x3[i])+sqr(y2[i])-sqr(y3[i]));
		r=sqrt(sqr(x1[i]-px)+sqr(y1[i]-py));
		cout<<fixed<<setprecision(3)<<px<<" "<<setprecision(3)<<py<<" "<<setprecision(3)<<r<<endl;

	}

	delete x1;
	delete y1;
	delete x2;
	delete y2;
	delete x3;
	delete y3;
	return 0;
}

void SolveSimultEq(double &x,double &y,double a,double b,double c,double d,double e,double f){
	double delta=a*e-b*d;
	
	x=(c*e-b*f)/delta;
	y=(a*f-c*d)/delta;
}