import std.stdio;
import std.typecons;
import std.math;

alias Tuple!(double, "x", double, "y") Point;
//ax+by=cの形である
alias Tuple!(double, "a", double, "b", double, "c") Equ;

Point solve_simequations(Equ e1, Equ e2){
	double det = e1.a*e2.b-e2.a*e1.b;
	//解がない det == 0;
	double x = (e2.b*e1.c-e1.b*e2.c)/det, y = (-e2.a*e1.c+e1.a*e2.c)/det;
	return Point(x, y);
}

Equ create_equation(Point p1, Point p2){
	Equ res = Equ(-(p1.y-p2.y), p1.x-p2.x, p1.x*p2.y-p2.x*p1.y);
	return res;
}

Equ vertical_equation(Point p1, Point p2){
	Equ res = Equ(2*(p1.x-p2.x), 2*(p1.y-p2.y), (p1.x-p2.x)*(p1.x+p2.x)+(p1.y-p2.y)*(p1.y+p2.y));
	return res;
}

double distance(Point p1, Point p2){
	return sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y));
}

double rounding(double d, int digits){
	double res = d;
	res *= pow(10, digits);
	res = cast(int)(res+0.5);
	res /= pow(10, digits);
	return res;
}

void main(){
	int n;
	readf("%d\n", &n);
	for(int i=n;i;i--){
		Point p1, p2, p3;
		readf("%f %f %f %f %f %f\n", &p1.x, &p1.y, &p2.x, &p2.y, &p3.x, &p3.y);
		Equ e1 = vertical_equation(p1, p2), e2 = vertical_equation(p2, p3);
		Point cp = solve_simequations(e1, e2);
		double dis = distance(p1, cp);
		writefln("%.3f %.3f %.3f", rounding(cp.x, 3), rounding(cp.y, 3), rounding(dis, 3));
	}
}