#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
  
int main(){
    
    int num;
    cin >> num;
    for(int i = 0; i<num; i++) {
        double x1, y1, x2, y2, x3, y3;
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        double p = ((y1-y3) * (y1*y1 - y2*y2 + x1*x1 - x2*x2) - (y1-y2) * (y1*y1 - y3*y3 + x1*x1 - x3*x3)) / (2 * (y1-y3) * (x1-x2) - 2 * (y1- y2) * (x1 - x3));
  
        double q = ((x1-x3) * (x1*x1 - x2*x2 + y1*y1 - y2*y2) - (x1-x2) * (x1*x1 - x3*x3 + y1*y1 - y3*y3)) / (2 * (x1-x3) * (y1- y2) - 2 * (x1-x2) * (y1-y3));
  
        double r1 = sqrt( (p-x1)*(p-x1) + (q - y1)*(q - y1) );
        double r2 = sqrt( (p-x2)*(p-x2) + (q - y2)*(q - y2) );
        double r3 = sqrt( (p-x3)*(p-x3) + (q - y3)*(q - y3) );
        double r = ( r1 + r2 + r3 ) / 3.0;
  
        cout << showpoint << fixed << setprecision(3);
        cout << p << " " << q << " " << r << endl;
        
        return 0;
    }
}