#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<algorithm>
using namespace std;
#define int long long

signed main(){

        int n;
        scanf("%lld",&n);
        for(int i=0;i<n;i++){
                double x1,x2,x3,y1,y2,y3;
                scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);
                double t1 = atan2(x2-x1,y2-y1);
                double t2 = atan2(x3-x1,y3-y1);
                double d = sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
                double r = d/sin(abs(t1-t2))/2;
                double d2 = sqrt(r*r-d*d/4);
                double xc = (x3+x2)/2 - (y3-y2)/d*d2;
                double yc = (y3+y2)/2 - (x3-x2)/d*d2;
                printf("%.3f %.3f %.3f\n", xc,yc, r);

        }

        return 0;
}