#include <iostream>
#include <math.h>

struct Point {
	double x, y;
};

double roundDig(double, int);

int main ()
{
	int num;
	Point a, b, c, p, mb, mc;
	double r;

	scanf("%d", &num);
	
	for (int i=0; i<num; i++) {
		scanf("%lf %lf %lf %lf %lf %lf", &a.x, &a.y, &b.x, &b.y, &c.x, &c.y);
		double A1 = 2 * (b.x - a.x), B1 = 2 * (b.y - a.y), C1 = a.x*a.x - b.x*b.x + a.y*a.y - b.y*b.y,
			   A2 = 2 * (c.x - a.x), B2 = 2 * (c.y - a.y), C2 = a.x*a.x - c.x*c.x + a.y*a.y - c.y*c.y;
		
		p.x = (B1*C1 - B2*C1) / (A1*B2 - A2*B1);
		p.y = (C1*A2 - C2*A1) / (A1*B2 - A2*B1);
		
		mb.x = (a.x + b.x) / 2; mb.y = (a.y + b.y) / 2;
		mc.x = (a.x + c.x) / 2; mc.y = (a.y + c.y) / 2;
		
		r = sqrt((p.x - a.x)*(p.x - a.x) + (p.y - a.y)*(p.x - a.y));
		 
		printf("%.3lf %.3lf %.3lf\n", roundDig(p.x, 4), roundDig(p.y, 4), r);
	}
	
    return 0;
}

double roundDig(double n, int dig)
{
	int multi = pow(10, dig);
	
	return (floor(n*multi + 5) / multi);
}