#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
long n,i;
double x1,y1,x2,y2,x3,y3,xx,yy,rr,s;
cin>>n;
for(i=0;i<n;i++){
cin>>x1>>y1>>x2>>y2>>x3>>y3;
if(cin.eof())break;
x1-=x3;x2-=x3;
y1-=y3;y2-=y3;
s=(x1*x2+y1*y2-x2*x2-y2*y2)/(x1*y2-x2*y1);
xx=x1*.5+s*y1;
yy=y1*.5-s*x1;
rr=sqrt(xx*xx+yy*yy);
xx+=x3;
yy+=y3;
printf("%.3f %.3f %.3f\n",xx,yy,rr);
}
return 0;
}