#include<iostream>
#include<math.h>
using namespace std;

typedef pair<double,double>vec;

vec operator + (vec v1,vec v2){
    return make_pair(v1.first+v2.first,v1.second+v2.second);
}

vec operator - (vec v1,vec v2){
    return make_pair(v1.first-v2.first,v1.second-v2.second);
}

vec operator * (double v,vec v2){
    return make_pair(v*v2.first,v*v2.second);
}

vec operator / (vec v1,double d){
    return make_pair(v1.first/d,v1.second/d);
}

int norm2(vec v1,vec v2){
    return (v1-v2).first*(v1-v2).first+(v1-v2).second*(v1-v2).second;
}

int main(){
    double x1,x2,x3,y1,y2,y3,n,r;
    cin>>n;
    while(n--){
        cin>>x1>>y1>>x2>>y2>>x3>>y3;
        vec A = make_pair(x1,y1);
        vec B = make_pair(x2,y2);
        vec C = make_pair(x3,y3);
        double a2,b2,c2,a,b,c,cosA,cosB,cosC,sinA,sinB,sinC,cos2A,cos2B,cos2C,sin2A,sin2B,sin2C;
        a2=norm2(B,C);
        b2=norm2(A,C);
        c2=norm2(A,B);
        a=sqrt(a2);
        b=sqrt(b2);
        c=sqrt(c2);
        cosA=(b2+c2-a2)/(2*b*c);
        cosB=(a2+c2-b2)/(2*c*a);
        cosC=(b2+a2-c2)/(2*b*a);
        sinA=sqrt(1-cosA*cosA);
        sinB=sqrt(1-cosB*cosB);
        sinC=sqrt(1-cosC*cosC);
        r=(a/sinA)/2;
        cos2A=cosA*cosA-sinA*sinA;
        cos2B=cosB*cosB-sinB*sinB;
        cos2C=cosC*cosC-sinC*sinC;
        sin2A=2*sinA*cosA;
        sin2B=2*sinB*cosB;
        sin2C=2*sinC*cosC;
        
        vec v=(sin2A*A+sin2B*B+sin2C*C )   /    (sin2A+sin2B+sin2C);
        printf("%.3f %.3f %.3f\n",v.first,v.second,r);
    }
    
}