 /*
Write a program which prints the central coordinate (px, py) and the radius r of a circumscribed circle of a triangle which is constructed by three points (x1, y1)(x2, y2)(x3, y3) on the plane surface.
 */

void solve(double a, double b, double c, double d, double e, double f) {
	double px,py,r;
	// ¼ñªüñÂÌð_ y-y1 = y2-y1 / x2-x1 * x-x1 -> y2-y1=a, x2-x1=b, y = a/b*x - a/b*x1-y1 -> y = -b/a*x + c
	double sl1 = -1*(c-a)/(d-b);			// (x1, y1)-(x2, y2)Ì¼ñªüÌX«
	double sl2 = -1*(e-c)/(f-d);			// (x2, y2)-(x3, y3)Ì¼ñªüÌX«
	double mid1x = (a+c)/2; double mid1y = (b+d)/2;
	double mid2x = (c+e)/2; double mid2y = (d+f)/2;
	double t1 = mid1y-sl1*mid1x;
	double t2 = mid2y-sl2*mid2x;
	// y = sl1*x - t1 Æ y = sl2*x - t2 ðA§B -> sl1*x - t1 = sl2*x - t2 -> (sl1-sl2)*x = t1 - t2
	px = (t1-t2)/(sl1-sl2);
	py = sl1*px - t1;
	r = sqr(px,py,a,b);
	printf("%4.3f %4.3f %4.3f",px,py,r);
}

double sqr(double a, double b, double c, double d) {
	// ñÂÌ_Ì£ðßé\bh
	double s = sqrt(pow(max(a,c)-min(a,c), 2) + pow(max(b,d)-min(b,d), 2));
	return s;
}

int main() {
	int n; cin >> n;
	double x1, y1, x2, y2, x3, y3;
	for (int i=0; i<n; i++) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		solve(x1,y1,x2,y2,x3,y3);
	}
	return 0;
}