#include<cstdio>
#include<cmath>

//#include<iostream>
using namespace std;

int main(){
	int n;
	float x1, y1, x2, y2, x3, y3, xp,yp, xq, yq, s1, sr1, s2, sr2;
	float b1, b2, xc, yc, r;
	scanf("%d", &n);
	while(n--){
		scanf("%f%f%f%f%f%f",&x1, &y1, &x2, &y2, &x3, &y3);

		if(!(y2-y1)){ 
			r=x1; x1=x3; x3=r; r=y1; y1=y3; y3=r;
		}
		xp=(x2+x1)/2; yp=(y2+y1)/2;
		xq=(x3+x1)/2; yq=(y3+y1)/2;
		sr1=-(x2-x1)/(y2-y1); b1=yp-sr1*xp;
		sr2=-(x3-x1)/(y3-y1); b2=yq-sr2*xq;

		xc=-(b1-b2)/(sr1-sr2);
		yc=sr1*xc+b1;
		r=sqrt((xc-x1)*(xc-x1)+(yc-y1)*(yc-y1));
		printf("%.3f %.3f %.3f\n",xc+.0005, yc+.0005, r+.0005);
	}
	return 0;
}