#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;

int main(void){
    double n, x1, x2, x3, y1, y2, y3, Px, Py, r;
    cin >> n;
    
    for(int i=1; i<=n; i++){
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    
        Px = ( (x1*x1 + y1*y1 - x3*x3 - y3*y3) / (2 * (y1-y3)) - (x2*x2 + y2*y2 - x3*x3 - y3*y3) / (2 * (y2-y3)) ) / ( (x1-x3)/(y1-y3) - (x2-x3)/(y2-y3) );
        Py = -(x1-x3) / (y1-y3) * Px + (x1*x1 + y1*y1 - x3*x3 - y3*y3) / (2 * (y1-y3));
        
        r = sqrt((x1-Px)*(x1-Px) + (y1-Py)*(y1-Py));

        cout << fixed << setprecision(3) << Px << " " << Py << " " << r << endl;
    }
    return 0;
}

