#include<complex.h>
#include<stdio.h>
#define F(a,b,c) acos((b*b+c*c-a*a)/2/b/c)
#define G(a,b) pow(a-b,2)
#define H(a,b,c,d) sqrt(G(a,b)-G(c,d))
int main(){
	typedef double D;
	int n;D d,e,f,g,h,i;
	for(scanf("%d",&n);n--;){
		scanf("%lf%lf%lf%lf%lf%lf",&d,&g,&e,&h,&f,&i);
		//complex a(d,g),b(e,h),c(f,i);
		D /*A=abs(b-c),B=abs(c-a),C=abs(a-b),*/
		A=H(e,h,d,g),B=H(f,i,d,g),C=(d,g,e,h),
		L=F(A,B,C),s=sin(2*L),t=sin(2*F(B,C,A)),u=sin(2*F(C,A,B)),v=s+t+u;
		printf("%.3f %.3f %.3f\n",(d*s+e*t+f*u)/v,(g*s+h*t+i*u)/v,A/sin(L)/2);
	}
}