#include<iostream>
#include<stdio.h>
#include<math.h>
#include<string>
#include<algorithm>
#include<utility>
using namespace std;
double zeti(double);
int main() {
    pair<double, double> a;
    pair<double, double> b;
    pair<double, double> c;
    pair<double, double> m1;
    pair<double, double> m2;
    double s1, s2,x1,y1,x2,y2,x,y,b1,b2;
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
        x = -1000.0;
        y = -1000.0;
        b1 = 0.0;
        b2 = 0.0;
        s1 = -1000.0;
        s2 = -1000.0;
        scanf("%lf%lf", &a.first, &a.second);
        scanf("%lf%lf", &b.first, &b.second);
        scanf("%lf%lf", &c.first, &c.second);
        m1.first = (a.first + b.first) / 2.0;
        m1.second = (a.second + b.second) / 2.0;
        m2.first = (b.first + c.first) / 2.0;
        m2.second = (b.second + c.second) / 2.0;
        //swap(m1.first, m1.second);
        //swap(m2.first, m2.second);
        //x is qual
        if (a.first - b.first == 0) {
            x = m1.second;
            b1 = m1.second;
            s1=0;
        }
        //y is qual
        else if (a.second - b.second == 0) {
            
            y = m1.first;
            
        }
        else {
            s1 = (zeti(a.second - b.second)) / (zeti(a.first - b.first));
            s1 = 1.0 / s1*-1.0;
            b1 = m1.second - s1*m1.first;
        }
        //x is qual
        if (b.first - c.first == 0) {
            x = m2.second;
            b2 = m2.second;
            s2=0;
        }
        //y is qual
        else if (b.second - c.second == 0) {
            y = m2.first;
        }
        else {
            s2 = (zeti(c.second - b.second)) / (zeti(c.first - b.first));
            s2 = 1.0 / s2*-1.0;
            b2 = m2.second - s2*m2.first;
        }
        double r,w,e;
        if(x!=-1000.0){
            if(s1==-1000.0){
                y=s2*x+b2;
            }
            else{
                y=s1*x+b2;
            }
            w = zeti(a.first - x);
            e = zeti(a.second - y);
            r = sqrt(w*w+e*e);
            printf("%.3lf %.3lf %.3lf\n", x, y,r);
            return 0;
            
        }
        if(y!=-1000.0){
            cout<<"b"<<endl;
            if(s1==-1000.0){
                x=(y-b2)/s2;
            }
            else{
                x=(y-b1)/s1;
            }
            w = zeti(a.first - x);
            e = zeti(a.second - y);
            r = sqrt(w*w+e*e);
            printf("%.3lf %.3lf %.3lf\n", x, y,r);
            return 0;
        }
        if (x == -1000.0) {
            x = (b1 - b2) / (s2 - s1);
        }
        if (y==-1000.0) {
            y = s2*x + b2;
        }
        
        
        w = zeti(a.first - x);
        e = zeti(a.second - y);
        r = sqrt(w*w+e*e);
        printf("%.3lf %.3lf %.3lf\n", x, y,r);
        
    }
    return 0;
}
double zeti(double center) {
    if (center < 0) {
        center *= -1;
    }
    return center;
}
