#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
#define REP0(i,n) for(int i=0;i<n;++i)
#define REP1(i,n) for(int i=1;i<=n;++i)
#define ALL(c) (c).begin(),(c).end()
const double eps=1e-9;
struct seg{double a,b,c;};
seg calc(double x1,double y1,double x2,double y2){
	double a=y1-y2,b=x2-x1,c=x2*y1-x1*y2;
	seg ret;
	ret.a=a;
	ret.b=b;
	ret.c=c;
	return ret;
}
int main(){
	int n;
	scanf("%d",&n);
	REP0(i,n){
		double x1,y1,x2,y2,x3,y3,ox,oy;
		scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
		seg k=calc(x1,y1,x2,y2);
		seg l=calc(x1,y1,x3,y3);
		double mx1=(x1+x2)/2,my1=(y1+y2)/2,mx2=(x1+x3)/2,my2=(y1+y3)/2;
		seg s1,s2;
		s1.a=k.b;
		s1.b=-k.a;
		s1.c=s1.a*mx1+s1.b*my1;
		s2.a=l.b;
		s2.b=-l.a;
		s2.c=s2.a*mx2+s2.b*my2;
		ox=(s1.c*s2.b-s2.c*s1.b)/(s1.a*s2.b-s2.a*s1.b);
		oy=(s1.a*s2.c-s2.a*s1.c)/(s1.a*s2.b-s2.a*s1.b);
		printf("%.3lf %.3lf %.3lf\n",ox+eps,oy+eps,sqrt((x1-ox)*(x1-ox)+(y1-oy)*(y1-oy))+eps);
	}
	return 0;
}