#include <complex>
#include <iostream>
#include <vector>

using namespace std;

struct complex_triangle{
    complex<double> a,b,c;

    complex_triangle(complex<double> &_a, complex<double> &_b, complex<double> &_c){
        a = _a;b = _b;c = _c;
    }
    
    double edge_lenth(int x){ //x= 0->bc, 1->ca, 2->ab  
        if(x==0) return abs(b-c);
        else if(x==1) return abs(c-a);
        else if(x==2) return abs(a-b);
    }

    double area(){
        complex<double> A = b - c, B = c - a;
        return abs(A.real()*B.imag() - A.imag()*B.real())/2;
    }

    double o_radi(){
        double ret = 1;
        for(int i=0;i<3;i++) ret *= edge_lenth(i);
        return ret/(4*area());
    }

    complex<double> o_cent(){ //外心
        complex<double> B = b - a, C = c - a,ret;
        double ss = (B.real()*C.imag() - B.imag()*C.real())*2;
        ret.real((C.imag()*norm(B) - B.imag()*norm(C))/ss);
        ret.imag((B.real()*norm(C) - C.real()*norm(B))/ss);
        ret += a;
        return ret;
    }
};

void solve(){
    double x1,x2,y1,y2,z1,z2;
    cin >> x1 >> x2 >> y1 >> y2 >> z1 >> z2;
    complex<double> x(x1, x2),y(y1, y2), z(z1, z2);
    complex_triangle da(x, y, z);
    complex<double> p = da.o_cent();
    //cout << da.area() << endl;
    printf("%.03f %.03f %.03f\n", p.real(), p.imag(), da.o_radi());
}

int main(){
    int n;cin >> n;
    for(int i = 0; i< n;i++) solve();
}

