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

using namespace std;

int main()
{
	int i;
	cin >> i;
	while (i--)
	{
		double x1, x2, x3, y1, y2, y3;
		double X1, X2, Y1, Y2;
		double x0, y0, R1, R2, R3;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		X1 = x2 - x1; X1 = X1 / 2;
		Y1 = y2 - y1; Y1 = Y1 / 2;
		X2 = x3 - x1; X2 = X2 / 2;
		Y2 = y3 - y1; Y2 = Y2 / 2;

		y0 = (X1*X2*X2 - X2*X1*X1 + X1*Y2*Y2 - X2*Y1*Y1) / (X1*Y2 - X2*Y1) + y1;
		x0 = (Y1*Y2*Y2 - Y2*Y1*Y1 + Y1*X2*X2 - Y2*X1*X1) / (Y1*X2 - Y2*X1) + x1;

		R1 = sqrt((x0 - x1)*(x0 - x1) + (y0 - y1)*(y0 - y1));

		printf("%.3lf %.3lf %.3lf", x0, y0, R1);
	}
	system("pause");
	return 0;
}