#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;

typedef double dbl;

int main() {
	int n;
	cin >> n;

	for (int i = 0; i < n; i++) {
		dbl x1, y1, x2, y2, x3, y3;
		dbl l1, l2, l3;

		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

		l1 = sqrt(pow(x3 - x2, 2) + pow(y3 - y2, 2));
		l2 = sqrt(pow(x1 - x3, 2) + pow(y1 - y3, 2));
		l3 = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));

		dbl s, S, r;

		s = (l1 + l2 + l3) / 2;
		S = sqrt(s * (s - l1) * (s - l2) * (s - l3));
		r = (l1 * l2 * l3) / (4 * S);

		dbl A, B, C, D, E, F;

		A = 2 * (x2 - x1); B = 2 * (y2 - y1); C = x2*x2 - x1*x1 + y2*y2 - y1*y1;
		D = 2 * (x3 - x1); E = 2 * (y3 - y1); F = x3*x3 - x1*x1 + y3*y3 - y1*y1;

		dbl ox, oy;

		ox = (C*E - B*F) / (A*E - B*D);
		oy = (A*F - C*D) / (A*E - B*D);

		if (ox == 0) ox = 0;
		if (oy == 0) oy = 0;
		printf("%.3f %.3f %.3f\n", ox, oy, r);
	}
}
