#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
class circle{
    public:
        void solve(double x1,double y1,double x2,double y2,double x3,double y3){
                double left,right,top,bottom,px,py,r;
                left=min(x1,min(x2,x3));
                right=max(x1,min(x2,x3));
                top=max(x1,min(x2,x3));
                bottom=min(x1,min(x2,x3));
                px=(left+right)/2;
                py=(top+bottom)/2;
                r=sqrt(pow(x1-px,2)+pow(y1-py,2));
                printf("%.3lf %.3lf %.3lf\n",px,py,r);
        }
};
int main(){
    circle inst;
    int n;
    double x1,y1,x2,y2,x3,y3;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>x1>>y1>>x2>>y2>>x3>>y3;
        inst.solve(x1,y1,x2,y2,x3,y3);
    }
}