import std.stdio;
import std.range;
import std.array;
import std.algorithm;
import std.conv;
import std.string;
import std.math;

void main()
{
	int n;
	readf("%d\n",&n);
	while(n--)
	{
		double[] coox = new double[4],
				 cooy = new double[4];
		readf("%f %f %f %f %f %f\n",&coox[0],&cooy[0],&coox[1],&cooy[1],&coox[2],&cooy[2]);
		coox[3] = coox[0];
		cooy[3] = cooy[0];
		
		double A1, B1, C1, A2, B2, C2;
		A1 = 2 *(coox[1] - coox[0]);
		B1 = 2 * (cooy[1] - cooy[0]);
		C1 = coox[0]^^2 - coox[1]^^2 + cooy[0]^^2 - cooy[1]^^2;
		A2 = 2 * (coox[2] - coox[0]);
		B2 = 2 * (cooy[2] - cooy[0]);
		C2 = coox[0]^^2 - coox[2]^^2 + cooy[0]^^2 - cooy[2]^^2;
		double centerx, centery, radius;
		centerx = (B1 * C2 - B2 * C1)/(A1 * B2 - A2 * B1);
		centery = (C1 * A2 - C2 * A1)/(A1 * B2 - A2 * B1);
		radius = sqrt((centerx - coox[0])^^2 + (centery -cooy[0])^^2);
		writefln("%.3f %.3f %.3f",centerx,centery,radius);
	}
}