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

void crpt(double a1, double b1, double c1, double a2, double b2, 
	double c2, double *x, double *y) {

	*x = (b2 * c1 - b1 * c2) / (a1 * b2 - a2 * b1);
	*y = (a1 * c2 - a2 * c1) / (a1 * b2 - a2 * b1);
}

int main()
{
	int n;
	double x1, y1, x2, y2, x3, y3;

	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

		double px, py, r;

		crpt(x2 - x1, y2 - y1, (x2 * x2 - x1 * x1 + y2 * y2 - y1 * y1) / 2, 
			x3 - x1, y3 - y1, (x3 * x3 - x1 * x1 + y3 * y3 - y1 * y1) / 2, &px, &py);

		r = sqrt((px - x1) * (px - x1) + (py - y1) * (py - y1));

		cout << setiosflags(ios::fixed | ios::showpoint) << setprecision(3)
			<< px << " " << py << " " << r << endl;
	}

	return 0;
}
