#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>

using namespace std;

struct point{
    double x;
    double y;
};

struct linear{
    double a;
    double b;
    double c;
};

linear get_linear(point a, point b){
    linear l;

    if(a.x == b.x){
        l.a = 1;
        l.b = 0;
        l.c = a.x;
    }else if(a.y == b.y){
        l.a = 0;
        l.b = 1;
        l.c = a.y;
    }else{
        l.a = (b.x-a.x)/(b.y-a.y);
        l.b = -1;
        l.c = a.x * l.a - a.y;
    }
    return l;
}

linear get_linear_vertical(point p, linear l){
    linear lv;
    lv.a = (-1)*l.b;
    lv.b = l.a;
    lv.c = lv.a*p.x + lv.b*p.y;
    return lv;
}

point get_cross_point(linear l1, linear l2){
    point p;
    p.x = (l1.b*l2.c - l1.c*l2.b)/(l1.b*l2.a - l1.a*l2.b);
    p.y = (l1.c*l2.a - l1.a*l2.c)/(l1.b*l2.a - l1.a*l2.b);
    return p;
}

double round3dig(double d){
    d *= 1000;
    d += (0.5 - (d < 0));
    d = int(d);
    if(d != 0)
        d /= 1000;
    return d;
}

double point_distance(point s, point e){
    double d;
    d = (e.x - s.x)*(e.x - s.x)+(e.y - s.y)*(e.y - s.y);
    d = sqrt(d);
    return d;
}

int main()
{
    int n;
    double r;
    point p[3], mp, cp;
    linear l1, l2;

    cin >> n;
    vector< point > v[n];
    for(int i = 0; i < n; ++i){
        cin >> p[0].x >> p[0].y >> p[1].x >> p[1].y >> p[2].x >> p[2].y;
        v[i].push_back(p[0]);
        v[i].push_back(p[1]);
        v[i].push_back(p[2]);
    }
    for(int i = 0; i < n; ++i){
        l1 = get_linear(v[i].at(0), v[i].at(1));
        mp.x = (v[i].at(1).x + v[i].at(0).x)/2;
        mp.y = (v[i].at(1).y + v[i].at(0).y)/2;
        l1 = get_linear_vertical(mp, l1);

        l2 = get_linear(v[i].at(0), v[i].at(2));
        mp.x = (v[i].at(2).x + v[i].at(0).x)/2;
        mp.y = (v[i].at(2).y + v[i].at(0).y)/2;
        l2 = get_linear_vertical(mp, l2);

        cp = get_cross_point(l1, l2);
        r = point_distance(v[i].at(0), cp);

        cp.x = round3dig(cp.x);
        cp.y = round3dig(cp.y);
        r = round3dig(r);

        cout << fixed << setprecision(3)
             << cp.x << ' ' << cp.y << ' ' << r << endl;
    }
    return 0;
}