#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>

using namespace std;
double min(double x0, double x1, double x2){ return min(min(x0, x1), x2); }
double max(double x0, double x1, double x2){ return max(max(x0, x1), x2); }
double d(double x, double y, double p, double q){ return sqrt((p-x)*(p-x)+(q-y)*(q-y)); }
double diff(double x0, double x1, double x2){ return max(x0,x1,x2)-min(x0,x1,x2); }
int main(){
	int n;
	cin >> n;
	double x[3], y[3];
	for(int j=0; j<n; j++){
	cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
	double ax,ay, r;
	double p, q;
	ax = (max(x[0],x[1],x[2]) + min(x[0],x[1],x[2]))/2;
	ay = (max(y[0],x[1],x[2]) + min(x[0],x[1],x[2]))/2;
	p = (max(x[0],x[1],x[2]) - min(x[0],x[1],x[2]))/4;
	q = (max(y[0],x[1],x[2]) - min(x[0],x[1],x[2]))/4;

	for(int i=0; i<10; i++){
		p = (max(x[0],x[1],x[2]) - min(x[0],x[1],x[2]))/4;
		q = (max(y[0],x[1],x[2]) - min(x[0],x[1],x[2]))/4;
		while(1){
		if(diff(d(x[0],y[0],ax+p,ay),d(x[1],y[1],ax+p,ay),d(x[2],y[2],ax+p,ay)) == diff(d(x[0],y[0],ax-p,ay),d(x[1],y[1],ax-p,ay),d(x[2],y[2],ax-p,ay))){
		}
		else if(diff(d(x[0],y[0],ax+p,ay),d(x[1],y[1],ax+p,ay),d(x[2],y[2],ax+p,ay)) > diff(d(x[0],y[0],ax-p,ay),d(x[1],y[1],ax-p,ay),d(x[2],y[2],ax-p,ay))){
			ax -= p;
		}
		else if(diff(d(x[0],y[0],ax+p,ay),d(x[1],y[1],ax+p,ay),d(x[2],y[2],ax+p,ay)) < diff(d(x[0],y[0],ax-p,ay),d(x[1],y[1],ax-p,ay),d(x[2],y[2],ax-p,ay)) ){
			ax += p;
		}
		if(p<0.0001) break;

		p /= 2;
		}

		while(1){
		if(diff(d(x[0],y[0],ax,ay+q),d(x[1],y[1],ax,ay+q),d(x[2],y[2],ax,ay+q)) == diff(d(x[0],y[0],ax,ay-q),d(x[1],y[1],ax,ay-q),d(x[2],y[2],ax,ay-q))){
		}
		if(diff(d(x[0],y[0],ax,ay+q),d(x[1],y[1],ax,ay+q),d(x[2],y[2],ax,ay+q)) > diff(d(x[0],y[0],ax,ay-q),d(x[1],y[1],ax,ay-q),d(x[2],y[2],ax,ay-q))){
			ax -= q;
		}
		else if(diff(d(x[0],y[0],ax,ay+q),d(x[1],y[1],ax,ay+q),d(x[2],y[2],ax,ay+q)) < diff(d(x[0],y[0],ax,ay-q),d(x[1],y[1],ax,ay-q),d(x[2],y[2],ax,ay-q))){
			ax += q;
		}
		if(q<0.0001) break;

		q /= 2;
		}
	}

	r = d(x[0],y[0],ax,ay);

	printf("%.3f %.3f %.3f\n",ax, ay, r);

}
	return 0;
}