#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
 
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<stdarg.h>
#include<malloc.h>

double round(double);

int main()
{
	int i, n;
	double x1, y1, x2, y2, x3, y3;
	double px, py, r;
	double a, b, c, cosA, sinA, hx;

	scanf("%d", &n);

	for(i=0; i<n; i++){

		scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
		
		a = sqrt(pow((x2-x3),2)+pow((y2-y3),2));
		b = sqrt(pow((x3-x1),2)+pow((y3-y1),2));
		c = sqrt(pow((x1-x2),2)+pow((y1-y2),2));

		cosA = (pow(b,2)+pow(c,2)-pow(a,2)) / (2*b*c);
		sinA = sqrt(1 - pow(cosA,2));
		r = a / (2*sinA);

		hx = sqrt(pow(r,2)-(pow(b,2)/4));
		
		if(pow(a,2)+pow(c,2) >= pow(b,2)){

			px = (x1+x3)/2 + (hx*(y1-y3))/b;
			py = (y1+y3)/2 + (hx*(x3-x1))/b;

		} else {

			px = (x1+x3)/2 - (hx*(y1-y3))/b;
			py = (y1+y3)/2 - (hx*(x3-x1))/b;

		}

		px = px * 1000;
		py = py * 1000;
		r = r * 1000;

		px = round(px);
		py = round(py);
		r = round(r);

		px = px / 1000;
		py = py / 1000;
		r = r / 1000;

		if(fabs(px) < 1e-6)
			px = 0;
		if(fabs(py) < 1e-6)
			py = 0;
		if(fabs(r) < 1e-6)
			r = 0;

		printf("%5.3f %5.3f %5.3f\n", px, py, r);

	}
	return 0;
}

double round(double x)
{
	if(x>=0)
		x = floor(x + 0.5);
	else
		x = -1.0 * floor(fabs(x) + 0.5);
	return x;
}