#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
struct {double x, y;} p[3], q[2], o;
int main()
{
	int n, i, j;
	double r, m[2], a, b, c, d;
	cin >> n;
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < 3; j++)
			cin >> p[j].x >> p[j].y;

		q[0].x = (p[0].x + p[1].x) / 2;
		q[0].y = (p[0].y + p[1].y) / 2;
		q[1].x = (p[0].x + p[2].x) / 2;
		q[1].y = (p[0].y + p[2].y) / 2;
		m[0] = ((p[0].x == p[1].x) ? 0 : (p[1].y-p[0].y)/(p[1].x-p[0].x));
		m[1] = ((p[0].x == p[2].x) ? 0 : (p[2].y-p[0].y)/(p[2].x-p[0].x));

		if (p[0].x == p[1].x)
		{
			c = -1/m[1];
			d = q[1].x/m[1]+q[1].y;
			o.y = q[0].y;
			o.x = (d-o.y)/c;
		}
		else if (p[0].x == p[2].x)
		{
			a = -1/m[0];
			b = q[0].x/m[0]+q[0].y;
			o.y = q[1].y;
			o.x = (b-q[1].y)/a;
		}
		else
		{
			a = -1/m[0];
			b = q[0].x/m[0]+q[0].y;
			c = -1/m[1];
			d = q[1].x/m[1]+q[1].y;
			o.x = (d-b)/(a-c);
			o.y = a*o.x+b;
		}
		r = sqrt((p[0].x-o.x)*(p[0].x-o.x)+(p[0].y-o.y)*(p[0].y-o.y));
		cout << setprecision(3) << setiosflags(ios::fixed);
		cout << o.x << " " << o.y << " " << r << endl;
	}
}