#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
	int n;
	double x1, x2, x3;
	double y1, y2, y3;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		double px, py, r;
		double A = (x2 - x1)*(y3 - y2) - (y2 - y1)*(x3 - x2);
		px = 0.5*((y3 - y2)*(x2*x2 - x1*x1 + y2*y2 - y1*y1) - (y2 - y1)*(x3*x3 - x2*x2 + y3*y3 - y2*y2)) / A;
		py = 0.5*(-(x3 - x2)*(x2*x2 - x1*x1 + y2*y2 - y1*y1) + (x2 - x1)*(x3*x3 - x2*x2 + y3*y3 - y2*y2)) / A;
		double a = px - x1;
		double b = py - y1;
		double r0 = (a*a + b*b);
		double r1 = sqrt(r0);
		cout << fixed << setprecision(3) << px << " " << py << " " << r1 << endl;
	}
	return 0;
}

