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

double round3(double d)
{
    return floor(d * 1000.0 + 0.5) / 1000.0;
}

int main()
{
    int n;
    std::cin >> n;

    for (int i = 0; i < n; ++i) {
        double x1, y1, x2, y2, x3, y3;
        std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

        double p = ((x1*x1-x2*x2+y1*y1-y2*y2)*(y1-y3)-(x1*x1-x3*x3+y1*y1-y3*y3)*(y1-y2))/(2*(x1-x2)*(y1-y3)-2*(x1-x3)*(y1-y2));
        double q = ((x1*x1-x2*x2+y1*y1-y2*y2)*(x1-x3)-(x1*x1-x3*x3+y1*y1-y3*y3)*(x1-x2))/(2*(x1-x3)*(y1-y2)-2*(x1-x2)*(y1-y3));
        double r = sqrt((x1 - p) * (x1 - p) + (y1 - q) * (y1 - q));

        std::cout << std::fixed << std::setprecision(3) << round3(p) << " " << round3(q) << " " << round3(r) << std::endl;
    }
}