#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef double D;
typedef complex<D> P;
typedef vector<P> VP;
P minEnclosingCircle(const VP& ps) {
  P c;
  double move = 0.5;
  r(i,39) {  // 2^(-39-1) \approx 0.9e-12
    r(t,50) {
      D max = 0;
      int k = 0;
      r (j, ps.size()) if (max < norm(ps[j]-c)) {
        max = norm(ps[j]-c);
        k = j;
      }
      c += (ps[k]-c) * move;
    }
    move /= 2;
  }
  return c;
}
int main(){
    int n;
    cin>>n;
    r(i,n){
        VP p;
        D a,b;
        r(j,3){
            cin>>a>>b;
            p.push_back(P(a,b));
        }
        P t=minEnclosingCircle(p);
        D dis=max(abs(p[0]-t),max(abs(p[1]-t),abs(p[2]-t)));
        printf("%.3f %.3f %.3f\n",t.real(),t.imag(),dis);
    }
}
