#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

typedef struct st_point {
	double x;
	double y;
} Point;

void calcVerticalBisector(Point &p1, Point &p2, double &a, double &b, double &c);
void SolvSimultaneousEquations(double a, double b, double c, double d, double e, double f, double &ansX, double &ansY);

int main(void)
{
	int n = 0;
	cin >> n;
	
	for(int i = 0; i < n; i++){
		Point p1 = {0};
		Point p2 = {0};
		Point p3 = {0};
		
		cin >> p1.x >> p1.y >> p2.x >> p2.y >> p3.x >> p3.y;
		
		double a1 = 0.0, b1 = 0.0, c1 = 0.0;
		double a2 = 0.0, b2 = 0.0, c2 = 0.0;
		
		//隣り合う頂点から垂直2等分線を2本求め、それらの交点を中点とする
		if(p1.y == p2.y){
			calcVerticalBisector(p1, p3, a1, b1, c1);
			calcVerticalBisector(p2, p3, a2, b2, c2);
		}
		else if(p2.y == p3.y){
			calcVerticalBisector(p1, p2, a1, b1, c1);
			calcVerticalBisector(p1, p3, a2, b2, c2);
		}
		else{
			calcVerticalBisector(p1, p2, a1, b1, c1);
			calcVerticalBisector(p2, p3, a2, b2, c2);
		}
		
		Point center = {0};
		SolvSimultaneousEquations(a1, b1, c1, a2, b2, c2, center.x, center.y);
		
		double radius = sqrt( (p1.x - center.x) * (p1.x - center.x) + (p1.y - center.y) * (p1.y - center.y) );
		
		cout << showpoint << setprecision(4) << center.x << " " << center.y << " " << radius << endl;
	}
	
	return 0;
}

void SolvSimultaneousEquations(double a, double b, double c, double d, double e, double f, double &ansX, double &ansY)
{
	//detが0になることはない
	double det = a * e - b * d;
	
	ansX = (c * e - b * f) / det;
	ansY = (a * f - c * d) / det;
}

void calcVerticalBisector(Point &p1, Point &p2, double &a, double &b, double &c)
{
	Point center = {0};
	center.x = (p1.x + p2.x) / 2.0;
	center.y = (p1.y + p2.y) / 2.0;
	
	//0割りが発生する場合は、slope=infとなり、a=0, c=-center.y となる
	double slope = (p1.y - p2.y) / (p1.x - p2.x);
	
	a = - 1.0 / slope;
	b = -1.0;
	c = - center.y - 1.0 / slope * center.x;
}