#include <iostream>
#include <cmath>

using namespace std;

double dist(double x1, double y1, double x2, double y2){
	return sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
}

int main(){

	double x[3], y[3];
	int n;

	cin >> n;
	while(n-- > 0){
		for(int i = 0; i < 3; i++){
			cin >> x[i] >> y[i];
		}

		double a = x[1] - x[0];
		double b = y[1] - y[0];
		double c = x[2] - x[1];
		double d = y[2] - y[1];
		double e = x[1]*x[1] - x[0]*x[0] + y[1]*y[1] - y[0]*y[0];
		double f = x[2]*x[2] - x[1]*x[1] + y[2]*y[2] - y[1]*y[1];

		double p = (e*d - f*b) / (2 * (a*d - b*c));
		double q = (e*c - f*a) / (2 * (b*c - a*d));

		double r = dist(x[0], y[0], p, q);

		cout.setf(ios::fixed);
		cout.precision(3);
		cout << p << ' ' << q << ' ' << r << endl;
	}

	return 0;
}