#include <iostream>
#include <algorithm>
#include <complex>
#include <vector>
#include <cmath>
#include <cstdio>
using namespace std;
typedef complex<double> P;

const double eps = 1e-5;
vector<P> ps(3);
double R;

double eval(P p) {
  double sum = 0;
  for(int i = 0; i < ps.size(); ++i)
    sum += abs(R-abs(p-ps[i]));
  return sum;
}

P getBestP(P o, double r) {
  double s = 200;
  double mini = 1e100;
  P bestP;
  double begin = -r;
  double end = r;
  for(int i = 0; i < s; ++i) {
    for(int j = 0; j < s; ++j) {
      P v(begin + j/s*(end-begin), begin + i/s*(end-begin));
      P p = o+v;
      double tmp = eval(p);
      if(tmp < mini) {
	mini = tmp;
	bestP = p;
      }
    }
  }
  return bestP;
}

int main() {
  int Tc;
  cin >> Tc;
  for(int tc = 0; tc < Tc; ++tc) {
    for(int i = 0; i < ps.size(); ++i) cin >> ps[i].real() >> ps[i].imag();
    R = abs(ps[1]-ps[2])/abs(sin(arg(ps[1]-ps[0])-arg(ps[2]-ps[0])))/2.0;
    P res(0,0);
    for(double r = 100.0; r > eps; r *= 0.1) {
      res = getBestP(res, r);
    }
    printf("%.3f %.3f %.3f\n", res.real(), res.imag(), R);
  }
  return 0;
}