#include <stdio.h>
#include <math.h>

int main(void)
{
	double x1, y1, x2, y2, x3, y3;
	double X, Y, r;
	double A1, B1, C1, A2, B2, C2;
	int n;
	int i;
	
	scanf("%d", &n);
	
	for (i = 0; i < n; i++){
		scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);
		A1 = 2 * (x2 - x1);
		B1 = 2 * (y2 - y1);
		C1 = x1 * x1 - x2 * x2 + y1 * y1 - y2 * y2;
		A2 = 2 * (x3 - x1);
		B2 = 2 * (x3 - x1);
		C2 = x1 * x1 - x3 * x3 + y1 * y1 - y3 * y3;
		
		X = (B1 * C2 - B2 * C1) / (A1 * B2 - A2 * B1);
		Y = (C1 * A2 - C2 * A1) / (A1 * B2 - A2 * B1);
		
		r = sqrt((X - x1) * (X - x1) + (Y - y1) * (Y - y1));
		
		printf("%.3lf %.3lf %.3lf\n", X, Y, r);
		
	}
	
	return 0;
}