#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
    int n;
    
    cin >> n;
    
    for (int i = 0; i < n; i++)
    {
        double x1, y1, x2, y2, x3, y3;
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        
        double a1, a2, b1, b2, c1, c2;
        a1 = (x2 - x1) * 2;
        b1 = (y2 - y1) * 2;
        c1 = x2 * x2  + y2 * y2 - x1 * x1 - y1 * y1;
        a2 = (x3 - x1) * 2;
        b2 = (y3 - y1) * 2;
        c2 = x3 * x3  + y3 * y3 - x1 * x1 - y1 * y1;
        
        double x, y, r;
        x = ((c1 * b2) - (c2 * b1)) / ((a1 * b2) - (a2 * b1));
        y = ((a1 * c2) - (a2 * c1)) / ((a1 * b2) - (a2 * b1));
        r = sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1));
        
        cout << setprecision(3) << fixed << x << " " << y << " " << r << endl;
    }
    
    return 0;
}

