#include <stdio.h>
#include <complex>

using namespace std;

typedef complex<double> point;
#define X real()
#define Y imag()
typedef point vec;

double cross(vec a, vec b)
{ return a.X * b.Y - b.X * a.Y; }

double dis(point a, point b)
{ return abs(a - b); }

point center(point A, point B, point C) // Circumcenter
{
	B -= A; C -= A;
	double b = norm(B), c = norm(C), d = 2 * cross(B, C);
	return A + point(C.Y * b - B.Y * c, B.X * c - C.X * b) / d;
}

int main()
{
	int dat;
	scanf("%d", &dat);
	while (dat--) {
		point p[3], c;
		for (int i = 0; i < 3; ++i) {
			double x, y;
			scanf("%lf%lf", &x, &y);
			p[i] = point(x, y);
		}
		c = center(p[0], p[1], p[2]);
		printf("%.3lf %.3lf %.3lf\n", c.X, c.Y, dis(c, p[0]));
	}
}