#include<iostream>
#include<iomanip>
#include<memory>
#include<array>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>

using namespace std;

int main()
{
  int n;
  array<double, 3> x;
  array<double, 3> y;
  array<double, 2> a;
  array<double, 2> b;
  array<double, 2> c;
  double cx, cy, r;

  cin >> n;
  for ( int j = 0; j < n; j++ )
    {
      for ( auto i = 0; i < x.size(); i++ )
        {
          cin >> x[i];
          cin >> y[i];
        }
      
      for ( auto i = 0; i < a.size(); i++ )
        {
          a[i] =  y[i+1] - y[i];
          b[i] =  x[i+1] - x[i];
          c[i] = (x[i+1] * x[i+1] - x[i] * x[i]) * 0.5 + (y[i+1] * y[i+1] - y[i] * y[i]) * 0.5;
        }
      
      cx = (b[1] * c[0] - b[0] * c[1]) / (a[0] * b[1] - a[1] * b[0]);
      cy = (a[0] * c[1] - a[1] * c[0]) / (a[0] * b[1] - a[1] * b[0]);
      r = sqrt( (x[0] - cx) * (x[0] - cx) + (y[0] - cy) * (y[0] - cy) );
      
      cout << fixed << setprecision(3) << cx << " " << cy << " " << r << endl;
    }
  return 0;
}