#include<complex>
#include<cmath>
#include<iostream>
#include<iomanip>
using namespace std;
typedef complex<double> P;
#define F(I,J,N) for(int I=J;I<N;I++)

class Line{
public:
	P p[2];
	P v;
	Line(){}
	Line(P p0,P p1){
		p[0]=p0;
		p[1]=p1;
		v=p1-p0;
	}
	double cross(P a,P b){
		return (real(a)*imag(b)-imag(a)*real(b));
	}
	//直線交点
	P IntersectionPoint(Line l){
		return p[0] + v * cross(l.v,l.p[0]-p[0]) / cross(l.v,v);
	}
};

int main(){
	int n;
	double x,y;
	P p[3],c[2],ce;
	Line l[2];
	cout<<setprecision(3)<<setiosflags(ios::fixed);
	cin>>n;
	F(a,0,n){
		F(i,0,3){cin>>x>>y;p[i]=P(x,y);}
		c[0]=(p[0]+p[1])/2.0;
		c[1]=(p[1]+p[2])/2.0;
		l[0]=Line(c[0],c[0]+(p[1]-p[0])*P(0,1));
		l[1]=Line(c[1],c[1]+(p[2]-p[1])*P(0,1));
		ce=l[0].IntersectionPoint(l[1]);
		cout<<ce.real()<<" "<<ce.imag()<<" "<<abs(ce-p[0])<<endl;
	}
	return 0;
}