#include<stdio.h>
#include <math.h>

double ceil2(double dIn, int nLen) {
	double dOut;

	dOut = dIn * pow(10.0, nLen);
	dOut = (double)(int)(dOut + 0.9);

	return dOut * pow(10.0, -nLen);
}

int main(void) {

	double x1[20], x2[20], x3[20], y1[20], y2[20], y3[20];
	double distance_12[20],distance_23[20],distance_31[20];
	int n = 0,i=0;
	double cosA,sinA,r,p,q;

	do {
		scanf("%d",&n);
	} while (n > 20);
	

	do {
		scanf("%lf%lf%lf%lf%lf%lf",&x1[i],&y1[i],&x2[i],&y2[i],&x3[i],&y3[i]);
		if((-100 <= (x1[i], x2[i], x3[i], y1[i], y2[i], y3[i])&&(100 >= (x1[i], x2[i], x3[i], y1[i], y2[i], y3[i]))))
		i++;
	} while (i < n);
	
	for (i = 0; i < n; i++) {
		distance_12[i] = sqrt(pow(x1[i] - x2[i], 2) + pow(y1[i] - y2[i], 2));
		distance_23[i] = sqrt(pow(x2[i] - x3[i], 2) + pow(y2[i] - y3[i], 2));
		distance_31[i] = sqrt(pow(x3[i] - x1[i], 2) + pow(y3[i] - y1[i], 2));
		}

	for (i = 0; i < n; i++) {
		p = ((y1[i] - y3[i])*(pow(y1[i],2) - pow(y2[i],2) + pow(x1[i],2) - pow(x2[i],2)) - (y1[i] - y2[i])*(pow(y1[i],2) - pow(y3[i],2) + pow(x1[i],2) - pow(x3[i],2))) / (2*(y1[i] - y3[i])*(x1[i] - x2[i]) - 2*(y1[i] - y2[i])*(x1[i] - x3[i]));
		q = ((x1[i] - x3[i])*(pow(x1[i],2) - pow(x2[i],2) + pow(y1[i],2) - pow(y2[i],2)) - (x1[i] - x2[i])*(pow(x1[i], 2) - pow(x3[i], 2) + pow(y1[i], 2) - pow(y3[i], 2))) / (2 * (x1[i] - x3[i])*(y1[i] - y2[i]) - 2 * (x1[i] - x2[i])*(y1[i] - y3[i]));
		cosA = (pow(distance_23[i], 2) + pow(distance_31[i], 2) - pow(distance_12[i], 2))/(2*distance_23[i]*distance_31[i]);
		sinA = sqrt(1 - pow(cosA, 2));
		r = distance_12[i] / (sinA * 2);
		printf("%.3lf %.3lf %.3lf\n",ceil2(p,4),ceil2(q,4),ceil2(r,4));
	}
	return 0;
}