#include <bits/stdc++.h>
#include <chrono>
using namespace std;

using _i64 = int64_t;
using _u64 = uint64_t;
using _f64 = double;

#define _for(i, start, end) for(_i64 i = (_i64)start; i < (_i64)end; ++i)
#define _rep(i, number) _for(i, 0, number)
#define _foreach(e, data) for(auto& e : data)
#define _all(data) data.begin(), data.end()

template<typename type>
_i64 _size(const type& data) { return static_cast<_i64>(data.size()); }
template<typename type, size_t size>
_i64 _size(const type (&)[size]) { return static_cast<_i64>(size); }

enum _flag : bool { able = true, disable = false };

struct _time {
    _time(_flag flag) { check = flag; if(!check) { return; } gettime(start); }
    ~_time() {
        if(!check) { return; }; gettime(end);
        _i64 elapse = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cout << endl << "Time: " << elapse << " ms" << endl;
    }
    private:
    using _timer = chrono::time_point<chrono::system_clock>;
    _timer start, end; bool check;
    void gettime(_timer& time) { time = chrono::system_clock::now(); }
};

struct _ini { _ini() { ios::sync_with_stdio(false); cin.tie(nullptr); } } _ini;

int main() {
    {
        _time time(disable);
        _f64 n, x1, y1, x2, y2, x3, y3, px, py, r, a, b, c, d, e, f;
        cin >> n;
        _rep(i, n) {
            cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
            a = x1 * 2 - x2 * 2;
            b = y1 * 2 - y2 * 2;
            c = pow(x1, 2) + pow(y1, 2) - pow(x2, 2) - pow(y2, 2);
            d = x2 * 2 - x3 * 2;
            e = y2 * 2 - y3 * 2;
            f = pow(x2, 2) + pow(y2, 2) - pow(x3, 2) - pow(y3, 2);
            px = (c * e - f * b) / (a * e - d * b) + DBL_EPSILON;
            py = (c * d - f * a) / (b * d - e * a) + DBL_EPSILON;
            r = sqrt(pow((px - x1), 2) + pow((py - y1), 2)) + DBL_EPSILON;
            cout << fixed << setprecision(3) << px << " " << py << " " << r << endl;
        }
    }
    return 0;
}
