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

double sisya(double x)
{
	int a = static_cast<int>(x * 10000);
	x = static_cast<double>(static_cast<int>(x * 1000)) / 1000;
	if(a < 0 && a%10 <= -5)
		return x-0.001;
	else if(a%10 >= 5)
		return x+0.001;
	return x;
}

double dif(double x,double y,double xx, double yy)
{
	return sqrt((x-xx)*(x-xx)+(y-yy)*(y-yy));
}

int main()
{
	int n;
	double x1,x2,x3,y1,y2,y3;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		double px = sisya(max(x1,max(x2,x3)) - (max(x1,max(x2,x3)) - min(x1,min(x2,x3))) / 2 );
		double py = sisya(max(y1,max(y2,y3)) - (max(y1,max(y2,y3)) - min(y1,min(y2,y3))) / 2 );
		double r  = sisya(dif(x1,y1,px,py));
		cout << setprecision(3) << fixed << px << " " << setprecision(3) << fixed << py << " " << setprecision(3) << fixed << r <<endl;
	}
	return 0;
}