#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
using namespace std;

const double EPS = 1e-8;

vector<double> gauss_jordan(const vector< vector<double> >& A, const vector<double>& b){
    int n = A.size();
    vector< vector<double> > B(n, vector<double>(n + 1));
    for(int i = 0 ; i < n ; ++i){
        for(int j = 0 ; j < n ; ++j){
            B[i][j] = A[i][j];
        }
    }
    for(int i = 0 ; i < n ; ++i){
        B[i][n] = b[i];
    }

    for(int i = 0 ; i < n ; ++i){
        int pivot = i;
        for(int j = i ; j < n ; ++j){
            if(abs(B[j][i]) > abs(B[pivot][i])){
                pivot = j;
            }
        }
        swap(B[i], B[pivot]);

        if(abs(B[i][i]) < EPS){
            return vector<double>();
        }

        for(int j = i + 1 ; j <= n ; ++j){
            B[i][j] /= B[i][i];
        }

        for(int j = 0 ; j < n ; ++j){
            if(i != j){
                for(int k = i + 1 ; k <= n ; ++k){
                    B[j][k] -= B[j][i] * B[i][k];
                }
            }
        }
    }

    vector<double> x(n);
    for(int i = 0 ; i < n ; ++i){
        x[i] = B[i][n];
    }

    return x;
}

int main(){
    int n;
    cin >> n;

    while(n--){
        vector< vector<double> > A(2, vector<double>(2));
        vector<double> b(2);
        vector<double> x(3), y(3);
        for(int i = 0 ; i < 3 ; ++i){
            cin >> x[i] >> y[i];
        }
        A[0][0] = 2.0 * (x[0] - x[1]);
        A[0][1] = 2.0 * (y[0] - y[1]);
        b[0] = x[0] * x[0] + y[0] * y[0] - x[1] * x[1] - y[1] * y[1];
        A[1][0] = 2.0 * (x[1] - x[2]);
        A[1][1] = 2.0 * (y[1] - y[2]);
        b[1] = x[1] * x[1] + y[1] * y[1] - x[2] * x[2] - y[2] * y[2];
        vector<double> p = gauss_jordan(A, b);
        double r = sqrt((x[0] - p[0]) * (x[0] - p[0]) + (y[0] - p[1]) * (y[0] - p[1]));
        cout << fixed << setprecision(3) << p[0] << ' ' << p[1] << ' ' << r << endl;
    }

    return 0;
}
