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

using namespace std;

int main() {
    int n;
    double x1, x2, x3, y1, y2, y3;
    double a, b, c, sinA, xa, ya, r;
    double cosA, cosB, cosC;

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

        a = sqrt(pow(x2 - x3, 2) + pow(y2 - y3,2));
        b = sqrt(pow(x1 - x3, 2) + pow(y1 - y3,2));
        c = sqrt(pow(x2 - x1, 2) + pow(y2 - y1,2));

        cosA = (pow(b, 2) + pow(c, 2) - pow(a, 2)) / (2 * b * c);
        cosB = (pow(c, 2) + pow(a, 2) - pow(b, 2)) / (2 * c * a);
        cosC = (pow(a, 2) + pow(b, 2) - pow(c, 2)) / (2 * a * b);

        sinA = sqrt(1.0 - pow(cosA, 2));

        xa = (a * cosA * x1 + b * cosB * x2 + c * cosC * x3) / (a * cosA + b * cosB + c * cosC);
        ya = (a * cosA * y1 + b * cosB * y2 + c * cosC * y3) / (a * cosA + b * cosB + c * cosC);
        r = a / (2.0 * sinA);

        cout << fixed << setprecision(3) << xa << " " << ya << " " << r << endl;
    }
}
