#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

void gaisetu(double x1,double y1,double x2,double y2,double x3,double y3){
  //center point.and r.
  double a,b,r;
  a = ((y2-y3)*(x1*x1-x2*x2+y1*y1-y2*y2) - (y1-y2)*(x2*x2-x3*x3+y2*y2-y3*y3))
    / (2*((x1-x2)*(y2-y3)-(x2-x3)*(y1-y2)));

  b = ((x2-x3)*(x1*x1-x2*x2+y1*y1-y2*y2) - (x1-x2)*(x2*x2-x3*x3+y2*y2-y3*y3))
    / (2*((y1-y2)*(x2-x3)-(y2-y3)*(x1-x2)));

  r = sqrt((a-x1)*(a-x1) + (b-y1)*(b-y1));

  cout << fixed << setprecision(3) << a << " " <<  b << " " << r <<  endl;
}
int main(){
  //gaisetu(0.0,0.0,2.0,0.0,2.0,2.0);
  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;
    gaisetu(x1,y1,x2,y2,x3,y3);
  }
  return 0;
}