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

using namespace std;

inline double SQ (double d) {
    return d * d;
}

int main (void) {
    int n;
    double x1, x2, x3, y1, y2, y3;
    cin >> n;
    while (n--) {
        cin >> x1; cin >> y1;
        cin >> x2; cin >> y2;
        cin >> x3; cin >> y3;
        double x, y;
        x = ((y1 - y2) * (SQ(x1) - SQ(x3) + SQ(y1) - SQ(y3)) -
             (y1 - y3) * (SQ(x1) - SQ(x2) + SQ(y1) - SQ(y2))) /
            (2 * (x1 - x3) * (y1 - y2) - 2 * (x1 - x2) * (y1 - y3));
        y = ((x1 - x2) * (SQ(y1) - SQ(y3) + SQ(x1) - SQ(x3)) -
             (x1 - x3) * (SQ(y1) - SQ(y2) + SQ(x1) - SQ(x2))) /
            (2 * (y1 - y3) * (x1 - x2) - 2 * (y1 - y2) * (x1 - x3));
        double r = sqrt(SQ(x1- x) + SQ(y1 - y));
        cout << setprecision(3) << fixed << x << ' ' << y << ' ' << r << endl;
    }
    return 0;
}