#include<cstdio>
#include<cmath>

//#include<iostream>
using namespace std;

int main(){
	int n;
	float x1, y1, x2, y2, x3, y3, a1,b1,c1,a2,b2,c2;
	float xc, yc, r;

	scanf("%d", &n);
	while(n--){
		scanf("%f%f%f%f%f%f",&x1, &y1, &x2, &y2, &x3, &y3);
	
//	http://pegasus.infor.kanazawa-it.ac.jp/~koblab/home/d1504310/acm/asia/1997/97_C_Minimal_Circle.html

    a1=(x2-x1)*2;
    b1=(y2-y1)*2;
    c1=x1*x1-x2*x2+y1*y1-y2*y2;
    a2=(x3-x1)*2;
    b2=(y3-y1)*2;
    c2=x1*x1-x3*x3+y1*y1-y3*y3;
    xc=(b1*c2-b2*c1)/(a1*b2-a2*b1);
    yc=(c1*a2-c2*a1)/(a1*b2-a2*b1);
    r=sqrt((x1-xc)*(x1-xc)+(y1-yc)*(y1-yc));
    printf("%.3f %.3f %.3f\n",xc,yc,r);
		
	}
	return 0;
}