#include <bits/stdc++.h>
#define int long long
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF (((ll)1<<31)-1)
#define eps LDBL_EPSILON
#define moder (1000000007)
#define pie 3.141592653589793238462643383279
#define P std::pair<int,int>
#define prique priority_queue
#define ggr getchar();getchar();return 0;
using namespace std;
int n;
double a,b,c,d,e,f;
pair<double,double> func(double A,double B,double C,double D,double E,double F){
    double ans1=(C*E-B*F)/(A*E-B*D),ans2=(C*D-A*F)/(B*D-A*E);
    if(C*E==B*F)ans1=0;
    if(C*D==A*F)ans2=0;
    return {ans1,ans2};
}
signed main(){
    cin>>n;
    rep(i,n){
        cin>>a>>b>>c>>d>>e>>f;
        double A=2*(-a+c),B=2*(-b+d),C=a*a+b*b-c*c-d*d;
        double D=2*(-a+e),E=2*(-b+f),F=a*a+b*b-e*e-f*f;
        pair<double,double> p=func(A,B,-C,D,E,-F);
        double ans1=p.first,ans2=p.second;
        printf("%.3lf %.3lf %.3lf\n",ans1,ans2,hypot(a-ans1,b-ans2));
    }
    ggr;
}
