#include<iostream>
#include<iomanip>
#include<cmath>
#include<algorithm>
using namespace std;
int t;
double x1,y_1,x2,y2,x3,y3,x,y,r;
int main(){
    cin>>t;
    for(int i=1;i<=t;i++){
        cin>>x1>>y_1>>x2>>y2>>x3>>y3;
        x=((x1*x1+y_1*y_1-x2*x2-y2*y2)/2*(y_1-y3)-(x1*x1+y_1*y_1-x3*x3-y3*y3)/2*(y_1-y2))/(x1*(y2-y3)+x2*(y3-y_1)+x3*(y_1-y2));
        y=((x1*x1+y_1*y_1-x3*x3-y3*y3)/2*(x1-x2)-(x1*x1+y_1*y_1-x2*x2-y2*y2)/2*(x1-x3))/(x1*(y2-y3)+x2*(y3-y_1)+x3*(y_1-y2));
        r=sqrt((x-x1)*(x-x1)+(y-y_1)*(y-y_1));
        cout<<fixed<<setprecision(3)<<x<<" "<<y<<" "<<r<<endl;
    }
    return 0;
}
