#include <iostream>
#include <cmath>
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    double x1, y1, x2, y2, x3, y3;
    while (n--) {
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

        if (y1 == y3) {
            swap(x3, x2);
            swap(y3, y2);
        }
        if (y2 == y3) {
            swap(x3, x1);
            swap(y3, y1);
        }
        double px, py, r;
        double a = x2 - x3;
        double b = y2 - y3;
        double c = x2 + x3;
        double d = y2 + y3;
        double e = x3 - x1;
        double f = y3 - y1;
        double g = x3 + x1;
        double h = y3 + y1;
        px = ((a/b)*(c/2) + d/2 - (e/f)*(g/2) - h/2) / (a/b - e/f);
        py = -(a/b) * px + (a/b) * c/2 + d/2;
        r = sqrt((x1 - px) * (x1 - px) + (y1 - py) * (y1 - py));

        cout.precision(3);
        cout << fixed << px << " " << py << " " << r << "\n";
    }
    return 0;
}