#include <iostream>
#include <iomanip>
#include <math.h>
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;

    for ( int j = 0; j < 3; j++ ) {
      if ( y1 == y2 || y2 == y3 ) {
	double k;
	k = x1;
	x1 = x2;
	x2 = x3;
	x3 = k;
	k = y1;
	y1 = y2;
	y2 = y3;
	y3 = k;
	continue;
      }
      double t1 = ( x1 - x2 ) / ( y2 - y1 );
      double t2 = ( x2 - x3 ) / ( y3 - y2 );
      double x = ( y1/2 - y3/2 - (x1+x2)/2*t1 + (x2+x3)/2*t2 ) / ( t2 - t1 );
      double y = ( x - (x1+x2)/2 ) * t1 + (y1+y2)/2;
      double l = sqrt( (x1-x)*(x1-x) + (y1-y)*(y1-y) );
      cout << fixed << setprecision(3) << x << " " << y << " " << l << endl;
      break;
    }

  }

}