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

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))

#define fr first
#define sc second

double dot(P a, P b) {
    return (a.X * b.X + a.Y * b.Y);
}
double cross(P a, P b) {
    return (a.X * b.Y - a.Y * b.X);
}

int ccw(P a, P b, P c) {
    b -= a; c -= a;
    if( cross(b,c) > EPS ) return +1;
    if( cross(b,c) < -EPS ) return -1;
    if( dot(b,c) < 0 ) return +2;
    if( norm(b) < norm(c) ) return -2;
    return 0;
}

P crossp_ll(P a1, P a2, P b1, P b2) {
    double d1 = cross(b2-b1, b1-a1);
    double d2 = cross(b2-b1, a2-a1);
    if( EQ(d1,0) && EQ(d2,0) ) return a1; // same line
    if( EQ(d2,0) ) assert(false); // precondition not satisfied
    return a1 + d1 / d2 * (a2 - a1);
}

// ????§???¢??????????????? a, b, c ???????????????????????£??????????????????
P circumcenter(P a, P b, P c) {
    a = (a-c) * 0.5;
    b = (b-c) * 0.5;
    return c + crossp_ll(a, a*P(1,1), b, b*P(1,1));
}

int main() {
    int n; cin >> n;
    for(int i=0; i<n; i++) {
        P a, b, c;
        cin >> a.X >> a.Y >> b.X >> b.Y >> c.X >> c.Y;

        double x = abs(a-b), y = abs(b-c) , z = abs(c-a);
        double cos = (x * x + y * y - z * z) / (2 * x * y);
        double sin = sqrt(1 - cos * cos);
        double r = z / sin / 2;

        P s = circumcenter(a,b,c);
        s.X = round(s.X * 1000) / 1000;
        s.Y = round(s.Y * 1000) / 1000;
        r = round(r * 1000) / 1000;
        printf("%.3f %.3f %.3f\n",s.X, s.Y, r);
    }
    return 0;
}