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

using namespace std;

int main()
{
	int i;
	cin >> i;
	while (i--)
	{
		float x1, y1, x2, y2, x3, y3, x_1, y_1,x_2,y_2,x,y,r;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		x_1 = x2 - x1; y_1 = y2 - y1;
		x_1 /= 2; y_1 /= 2;
		x_2 = x3 - x1; y_2 = y3 - y1;
		x_2 /= 2; y_2 /= 2;
		x = (y_1 * y_2*(y_2 - y_1) + (y_1*x_2*x_2 - x_1*x_1*y_2)) / (y_1*x_2 - x_1*y_2);
		y = (x_1 * x_2*(x_2 - x_1) + (x_1*y_2*y_2 - y_1*y_1*x_2)) / (x_1*y_2 - y_1*x_2);
		r = sqrt((x - x1)*(x - x1) + (y - y1)*(y - y1));
		printf("%.3f %.3f %.3f\n", x, y,r);
	}
	return 0;
}