#include <iostream>
#include <cmath>

using namespace std;

int main(void){
	int n;
	double x1,y1,x2,y2,x3,y3,m1,m2,x,y,r;
	double xa,ya,xb,yb,xc,yc;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>xa>>ya>>xb>>yb>>xc>>yc;
		if(yb==ya){
			x1=xa; y1=ya;
			x2=xc; y2=yc;
			x3=xb; y3=yb;
		} else if(yc==yb){
			x1=xc; y1=yc;
			x2=xa; y2=ya;
			x3=xb; y3=yb;
		} else {
			x1=xc; y1=yc;
			x2=xb; y2=yb;
			x3=xa; y3=ya;
		}
		m1=(x2-x1)/(y2-y1);
		m2=(x3-x2)/(y3-y2);
		x=(1/(m2-m1))*(y3-y1)+(x1+x2)/2*m1-(x2+x3)/2*m2;
		y=(x-(x1+x2)/2)*m1+(y1+y2)/2;
		r=sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y));
		printf("%.3f %.3f %.3f\n",x,y,r);
	}
}