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

int main(void)
{
	float x[2][3];
	int n;
	int xa, xb, xc;
	int ya, yb, yc;
	float ans[3];
	int i, j;
	
	scanf("%d", &n);
	
	while (n){
		for (i = 0; i < 3; i++){
			for (j = 0; j < 2; j++){
				scanf("%f", &x[j][i]);
			}
		}
		
		xa = 2 * (x[0][1] - x[0][0]);
		xb = 2 * (x[1][1] - x[1][0]);
		xc = x[0][0] * x[0][0] - x[0][1] * x[0][1] + x[1][0] * x[1][0] - x[1][1] * x[1][1];
		ya = 2 * (x[0][2] - x[0][0]);
		yb = 2 * (x[1][2] - x[1][0]);
		yc = x[0][0] * x[0][0] - x[0][2] * x[0][2] + x[1][0] * x[1][0] - x[1][2] * x[1][2];
		
		ans[0] = (xb * yc - yb * xc) / (xa * yb - ya * xb);
		ans[1] = (xc * ya - yc * xa) / (xa * yb - ya * xb);
		ans[2] = sqrt((ans[0] - x[0][0]) * (ans[0] - x[0][0]) + (ans[1] - x[1][0]) * (ans[1] - x[1][0]));
		
		for (i = 0; i < 3; i++){
			if (i){
				printf(" ");
			}
			printf("%.3f", ans[i]);
			
		}
		printf("\n");
		
		n--;
	}
	
	return (0);
}