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

int main(){
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		float x1, y1, x2, y2, x3, y3;
		scanf("%f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3);
		float a = (x2 - x3)*(x2 - x3) + (y2 - y3)*(y2 - y3);
		float b = (x1 - x3)*(x1 - x3) + (y1 - y3)*(y1 - y3);
		float c = (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2);
		float s = ((x2-x1)*(y3-y1) - (x3-x1)*(y2-y1)) / 2;
		float x = (a*(b + c - a)*x1 + b*(c + a - b)*x2 + c*(a + b - c)*x3) / (16*s*s);
		float y = (a*(b + c - a)*y1 + b*(c + a - b)*y2 + c*(a + b - c)*y3) / (16*s*s);
		float r = sqrt((x-x1)*(x-x1) + (y-y1)*(y-y1));
		printf("%.3f %.3f %.3f\n", x, y, r);
	}
	return 0;
}
