#include <iostream>
#include <cmath>
#include <cstdio>
#include <string>
#include <sstream>

using namespace std;

long double sisya(long double a) {
	a *= 1000.0;
	//cout << a << endl;
	a += 0.5;
	a = (int)a;
	a /= 1000.0;
	return a; 
}

long double ll(long double x1, long double y1, long double x2, long double y2) {
	return ((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		long double dd[3][2];
		for (int j = 0; j < 3; j++) {
			cin >> dd[j][0] >> dd[j][1];
		}
		long double k[3];
		k[0] = ll(dd[1][0],dd[1][1],dd[2][0],dd[2][1]);
		k[1] = ll(dd[2][0],dd[2][1],dd[0][0],dd[0][1]);
		k[2] = ll(dd[0][0],dd[0][1],dd[1][0],dd[1][1]);
		long double S, X, Y, R;
		S = ((dd[1][0]-dd[0][0])*(dd[2][1]-dd[0][1])-(dd[1][1]-dd[0][1])*(dd[2][0]-dd[0][0]))*((dd[1][0]-dd[0][0])*(dd[2][1]-dd[0][1])-(dd[1][1]-dd[0][1])*(dd[2][0]-dd[0][0]))/4.0;
		X = (k[0]*(k[1]+k[2]-k[0])*dd[0][0]+k[1]*(k[2]+k[0]-k[1])*dd[1][0]+k[2]*(k[0]+k[1]-k[2])*dd[2][0])/(16.0*S);
		Y = (k[0]*(k[1]+k[2]-k[0])*dd[0][1]+k[1]*(k[2]+k[0]-k[1])*dd[1][1]+k[2]*(k[0]+k[1]-k[2])*dd[2][1])/(16.0*S);
		R = sqrt(ll(X, Y, dd[0][0], dd[0][1]));
		X = sisya(X);
		Y = sisya(Y);
		R = sisya(R);
		printf("%.3f %.3f %.3f\n", X, Y, R);
	}
	return 0;
}