#include <iomanip>
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <complex>

#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;

typedef long double ld;
typedef complex<ld> P;
typedef vector<P> VP;
const ld eps = 1e-8, pi = acos(-1.0);

#define EQ(a,b) (abs((a)-(b))<eps)

class C { public: P p; ld r; };

ld dot (P a, P b) { return real(conj(a) * b); }
ld cross (P a, P b) { return imag(conj(a) * b); }

VP is_cc(C c1, C c2){
  VP res;
  ld d = abs(c1.p - c2.p);
  ld rc = (d * d + c1.r * c1.r - c2.r * c2.r) / (2 * d);
  ld dfr = c1.r * c1.r - rc * rc;
  if (abs(dfr) < eps) dfr = 0.0;
  else if (dfr < 0.0) return res; // no intersection
  ld rs = sqrt(dfr);
  P diff = (c2.p-c1.p)/d;
  res.push_back(c1.p + diff * P(rc, rs));
  if (dfr != 0.0) res.push_back(c1.p + diff * P(rc, -rs));
  return res;
}

ld circumradius(VP tri) {
  P x = tri[1] - tri[0];
  P y = tri[2] - tri[0];
  ld sxy = cross(x,y)/abs(x)/abs(y);
  return abs(x-y)/sxy/2;
}

P circumcenter(VP tri) {
  ld r = circumradius(tri);
  C c0 = {tri[0], r};
  C c1 = {tri[1], r};
  VP vcc = is_cc(c0, c1);
  if (abs(abs(vcc[0] - tri[2]) - r) < eps) return vcc[0];
  return vcc[1];
}

int main() {
  int n;
  cin>>n;
  REP(i,n) {
    VP p(3);
    REP(j,3) {
      ld x,y;
      cin>>x>>y;
      p[j] = P(x,y);
    }
    P cc = circumcenter(p);
    ld r = circumradius(p);
    cout<<setprecision(3)<<fixed<<real(cc)<<' '<<imag(cc)<<' '<<r<<endl;
  }
  return 0;
}