#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
int main(void){

    double A1,A2,B1,B2,C1,C2,X1,X2,X3,Y1,Y2,Y3,X,Y,r;
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
    cin>>X1>>X2>>X3>>Y1>>Y2>>Y3;
    A1=2*(X2-X1);
    B1=2*(Y2-Y1);
    C1=X1*X1-X2*X2+Y1*Y1-Y2*Y2;
    A2=2*(X3-X1);
    B2=2*(Y3-Y1);
    C2=X1*X1-X3*X3+Y1*Y1-Y3*Y3;

    X=(B1*C2-B2*C1)/(A1*B2-A2*B1);
    Y=(C1*A2-C2*A1)/(A1*B2-A2*B1);
    X+=0.0005,Y+=0.0005;
    X=floor(X),Y=floor(Y);

    r=sqrt((X1-X)*(X1-X)+(Y2-Y)*(Y2-Y));

    printf("%.3lf %.3lf %.3lf",X,Y,r);
    }

	return 0;
}