#include <iostream>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <vector>

using namespace std;

int main(void){
	int num;
	cin >> num;
	vector<double> res_x, res_y, res_r;
	for (int i=1; i<=num; ++i){
		double x1, y1, x2, y2, x3, y3;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		double e1_2 = sqrt(pow((x2-x1), 2) + pow((y2-y1), 2));
		double e2_3 = sqrt(pow((x2-x3), 2) + pow((y2-y3), 2));
		double e3_1 = sqrt(pow((x3-x1), 2) + pow((y3-y1), 2));
		double theta = acos((e1_2*e1_2 + e2_3*e2_3 - e3_1*e3_1) / (2*e1_2*e2_3));
		//正弦定理により
		double r = e3_1 / (2*sin(theta));
		double a1 = 2*(x2-x1);
		double b1 = 2*(y2-y1);
		double c1 = x1*x1 - x2*x2 + y1*y1 -y2*y2;
		double a2 = 2*(x3-x1);
		double b2 = 2*(y3-y1);
		double c2 = x1*x1 - x3*x3 + y1*y1 - y3*y3;
		double x = (b1*x2 - b2*c1) / (a1*b2 - a2*b1);
		double y = (c1*a2 - c2*a1) / (a1*b2 - a2*b1);
		res_x.push_back(x);
		res_y.push_back(y);
		res_r.push_back(r);
	}
	for (int i=0; i<num; ++i){
		cout << fixed << setprecision(3) << res_x[i] << " " << res_y[i] << " " << res_r[i] << endl;
	}
	return 0;
}