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

//ax+b
struct line
{
	double a;
	double b;
	line(){a=0,b=0;}
	line(double x0, double y0, double x1, double y1)
	{
		a=-(x1-x0)/(y1-y0);
		b=(y0+y1)/2.0-a*(x0+x1)/2.0;
	}
};

int main()
{
	int n;
	cin >> n;
	for(int i=0; i<n; ++i)
	{
		double x1,y1,x2,y2,x3,y3;
		cin >> x1>>y1>>x2>>y2>>x3>>y3;
		line l[2];

		if(y1==y2)
		{
			l[0] = line(x2,y2,x3,y3);
			l[1] = line(x3,y3,x1,y1);
		}
		else if(y2==y3)
		{
			l[0] = line(x1,y1,x2,y2);
			l[1] = line(x3,y3,x1,y1);
		}
		else
		{
			l[0] = line(x1,y1,x2,y2);
			l[1] = line(x2,y2,x3,y3);
		}
		
		double x = (l[1].b-l[0].b)/(l[0].a-l[1].a);
		double y = l[0].a*x+l[0].b;
		double r = sqrt( (x-x1)*(x-x1) + (y-y1)*(y-y1) );
		printf("%.3f %.3f %.3f\n", x, y, r);
	}
}