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

void solve(double a, double b, double c, double d, double p, double q, double *x, double *y){
    *x = (p * d - b * q) / (a * d - b * c);
    *y = (a * q - p * c) / (a * d - b * c);
}

int main(){
    int n;
    double x1, y1, x2, y2, x3, y3, xp, yp, r, d12, d23, d31;
    
    std::cin >> n;
    for(int i=0; i<n; i++){
        std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        solve(2 * (x1 - x2), 2 * (y1 - y2), 2 * (x1 - x3), 2 * (y1 - y3),
            pow(x1, 2) + pow(y1, 2) - pow(x2, 2) - pow(y2, 2),
            pow(x1, 2) + pow(y1, 2) - pow(x3, 2) - pow(y3, 2), &xp, &yp);
        d12 = sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
        d23 = sqrt(pow(x2 - x3, 2) + pow(y2 - y3, 2));
        d31 = sqrt(pow(x3 - x1, 2) + pow(y3 - y1, 2));
        r = d12 * d23 * d31 / sqrt((d12 + d23 + d31)*(-d12 + d23 + d31)*(d12 - d23 + d31)*(d12 + d23 - d31));
        std::cout << std::fixed << std::setprecision(3)
            << xp << ' ' << yp << ' ' << r << std::endl;
    }
}