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

using T = double;
const T EPS = 1e-10;

/* Point */
using P = complex<T>;
#define x real()
#define y imag()
template <typename T> inline bool eq(T p, T q) { return abs(p - q) < EPS; }
inline int sgn(T x) { return (T(0) < x) - (x < T(0)); }
inline T dot(P v, P w) { return (conj(v) * w).x; }
inline T cross(P v, P w) { return (conj(v) * w).y; }
inline bool isOrth(P v, P w) { return dot(v, w) == 0; }
inline bool isPara(P v, P w) { return cross(v, w) == 0; }
inline P translate(P p, P v) { return p + v; }
inline P scale(P p, P c, T k) { return c + (p - c) * k; }
inline P rot(P p, T a) { return p * polar(1.0, a); }
inline P rot90(P p) { return {-p.y, p.x}; }
inline T orient(P a, P b, P c) { return cross(b - a, c - a); }
istream& operator>>(istream& is, P& p) {
    T xx, yy;
    is >> xx >> yy;
    p = P(xx, yy);
    return is;
}

/* Circle */
struct C : P {
    T r;
    C(P p = P(0.0, 0.0), T r = 0.0) : P(p), r(r) {}
    friend ostream& operator << (ostream& os, const C& c) { return os << '(' << c.x << ", " << c.y << ", " << c.r << ')'; }
};

P circumCenter(P a, P b, P c) {
    b -= a, c -= a;
    assert(cross(b, c) != 0);
    return a + rot90(b * norm(c) - c * norm(b)) / cross(b, c) / T(2);
}

int main() {
    cout << fixed << setprecision(3);
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        P p[3];
        for (int j = 0; j < 3; ++j) {
            cin >> p[j];
        }
        P o = circumCenter(p[0], p[1], p[2]);
        cout << o.x << " " << o.y << " " << abs(p[0] - o) << endl;
    }
}
