#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

int n;
double x[4],y[4],r;

int main(){
	cin >> n;
	while(n--){
		for(int i=0;i<3;i++){
			cin >> x[i] >> y[i];
		}
		if(2*(y[2]-y[0])*(x[1]-x[0])==(y[1]-y[0])*(x[2]-x[0])){
			double z=x[0];
			x[0]=x[2];
			x[2]=z;
			z=y[0];
			y[0]=y[2];
			y[2]=z;
		}
		x[3]=((y[2]-y[1])*(x[1]-x[0])*(x[2]-x[0])-(y[1]-y[0])*(x[1]+x[0])*(x[2]-x[0])+(y[2]-y[0])*(x[1]-x[0])*(x[2]+x[0]))/(2*(y[2]-y[0])*(x[1]-x[0])-(y[1]-y[0])*(x[2]-x[0]));
		if(x[0]==x[1]){
			double z=x[0];
			x[0]=x[2];
			x[2]=z;
			z=y[0];
			y[0]=y[2];
			y[2]=z;
		}
		y[3]=(y[0]+y[1])/2-(y[1]-y[0])*(x[3]-(x[0]+x[1])/2)/(x[1]-x[0]);
		r=sqrt(pow((x[3]-x[2]),2)+pow((y[3]-y[2]),2));
		printf("%.3lf %.3lf %.3lf\n",x[3]+0.00001,y[3]+0.00001,r);
	}
	return 0;
}