//04
#include<iostream>
#include<complex>
#include<iomanip>
#include<cmath>

#define S(X) ((X)*(X))

using namespace std;

int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    complex<double> p[3];
    for(int j=0;j<3;j++){
      double x,y;
      cin>>x>>y;
      p[j]=complex<double>(x,y);
    }
    double d[3];
    for(int j=0;j<3;j++){
      d[j]=abs(p[j]-p[(j+1)%3]);
    }
    double r=d[0]/2/sqrt(1-S((S(d[1])+S(d[2])-S(d[0]))/2/d[1]/d[2]));
    complex<double> c=p[0]+polar(r,arg(p[1]-p[0])+acos(d[1]/2/r));
    cout<<fixed<<setprecision(3)<<c.real()<<' '<<c.imag()<<' '<<r<<endl;
  }
  return 0;
}