#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;
typedef vector<int> VI;
#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    vector<tuple<pair<double, double>, pair<double, double>, pair<double, double>>> triangles;
    int n;
    cin >> n;
    REP(i, 0, n) {
        pair<double, double> a, b, c;
        cin >> a.first >> a.second >> b.first >> b.second >> c.first >> c.second;
        tuple<pair<double, double>, pair<double, double>, pair<double, double>> triangle(a, b, c);
        triangles.push_back(triangle);
    }

    for (auto tri : triangles) {
        double a1, a2, b1, b2, c1, c2;
        a1 = 2 * (get<1>(tri).first - get<0>(tri).first);
        b1 = 2 * (get<1>(tri).second - get<0>(tri).second);
        c1 = pow(get<0>(tri).first, 2.0) - pow(get<1>(tri).first, 2.0) + pow(get<0>(tri).second, 2.0) - pow(get<1>(tri).second, 2.0);
        a2 = 2 * (get<2>(tri).first - get<0>(tri).first);
        b2 = 2 * (get<2>(tri).second - get<0>(tri).second);
        c2 = pow(get<0>(tri).first, 2.0) - pow(get<2>(tri).first, 2.0) + pow(get<0>(tri).second, 2.0) - pow(get<2>(tri).second, 2.0);

        double x = (b1*c2 - b2*c1) / (a1*b2 - a2*b1);
        double y = (c1*a2 - c2*a1) / (a1*b2 - a2*b1);
        double r = sqrt(pow(x-get<0>(tri).first, 2.0) + pow(y-get<0>(tri).second, 2.0));

        cout.setf(ios::fixed, ios::floatfield);
        cout.precision(3);
        cout << x << " " << y << " " << r << endl;
    }

    return 0;
}