#include <stdio.h>
#include <math.h>
#define NOT_E 200

double cequal(double *a,double *b,double *c,double *aa,double *bb,double *cc);
double equal(double a,double b,double c,double aa,double bb,double cc);
double answer(double x1,double x2,double y1,double y2,double *a,double *b);
int swap(double *a,double *b);

int main(){
	int i,cnt;
	double x1,x2,x3,y1,y2,y3,xp,yp/*¦*/,a1,a2,b1,b2,xm1,ym1,xm2,ym2,r;
	
	scanf("%d",&cnt);
	for(i=0;i<cnt;i++){
		
		scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
		
		xp=equal(y1,y2,y3,x1,x2,x3);
		yp=equal(x1,x2,x3,y1,y2,y3);
		
		
		if (xp==NOT_E || yp==NOT_E){
			if(xp==NOT_E){
				cequal(&x1,&x2,&x3,&y1,&y2,&y3);
			}else if(yp==NOT_E){
				cequal(&y1,&y2,&y3,&x1,&x2,&x3);
			}
			answer(x3,x2,y3,y2,&a1,&b1);
			answer(x3,x1,y3,y1,&a2,&b2);
			xp=(b2-b1)/(a1-a2);
			yp=a1*xp+b1;
			
		}
		
		if(xp==x1){
			r=sqrt((xp-x1)*(xp-x1));
		}else if(yp==y2){
			r=sqrt((yp-y1)*(yp-y1));
		}else{
			r=sqrt((xp-x1)*(xp-x1)+(yp-y1)*(yp-y1));
		}
		
		printf("%.3f %.3f %.3f\n",xp,yp,r);

	}
	return 0;
}
			
			
			
			

double cequal(double *a,double *b,double *c,double *aa,double *bb,double *cc){	/*a1=a2,a3ÆÈéæ¤ÉÀÑÖ¦é*/
	if(*a==*b){
	}else if (*b==*c){
		swap(a,c);
		swap(aa,cc);
	}else if (*c==*a){
		swap(b,c);
		swap(bb,cc);
	}else{
		return NOT_E;
	}
	
	return (*a+*b)/2;
}


double equal(double a,double b,double c,double aa,double bb,double cc){	/*ÀÑÖ¦È¢*/
	if(a==b){
	}else if (b==c){
		swap(&a,&c);
		swap(&aa,&cc);
	}else if (c==a){
		swap(&b,&c);
		swap(&bb,&cc);
	}else{
		return NOT_E;
	}
	return (aa+bb)/2;
}



double answer(double x1,double x2,double y1,double y2,double *a,double *b){	/*(x1,y1)Æ(x2,y2)Ì¼ñªüy=ax+bÌa,bð|C^ÅÔ·*/
	double xm,ym;
	*a=(y2-y1)/(x1-x2);
	xm=(x2+x1)/2;
	ym=(x2+y1)/2;
	*b=ym-*a*xm;
	return 0;
}

int swap(double *a,double *b){
	double temp;
	temp=*a;
	*a=*b;
	*b=*a;
	return 0;
}
	/*
	a2=(y1-y3)/(x3-x1);
	xm2=(x1+x3)/2;
	ym2=(x1+y3)/2;
	b2=ym2-a3*xm2;*/
	