#include<iostream>
#include<complex>
#include<vector>
#include<cmath>
#include<algorithm>
#include<cstdio>

using namespace std;

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

#define X real()
#define Y imag()

typedef long double D;
typedef complex<D> P;

D aTri(D a, D b, D c){
  D s = (a + b + c) / 2;
  return sqrt(max(s * (s - a) * (s - b) * (s - c), (D)0));
}

P circumscribedCircleCenter(P a, P b, P c) {
  D ax = a.X, ay = a.Y;
  D bx = b.X, by = b.Y;
  D cx = c.X, cy = c.Y;
  D d = 2 * (ax * (by - cy) + bx * (cy - ay) + cx * (ay - by));
  return P(((ay * ay + ax * ax) * (by - cy) + by * by + bx * bx * (cy - ay) +
	    (cy * cy + cx * cx) * (ay - by)) / d,
	   ((ay * ay + ax * ax) * (cx - bx) + by * by + bx * bx * (ax - cx) +
	    (cy * cy + cx * cx) * (bx - ax)) / d);
}

D circumscribedCircleRadius(D a, D b, D c) {return a * b * c / (4 * aTri(a, b, c));}

int main() {
  int n;
  cin >> n;
  rep (i, n) {
    P a, b, c;
    cin >> a.X >> a.Y >> b.X >> b.Y >> c.X >> c.Y;
    P p = circumscribedCircleCenter(a, b, c);
    D r = circumscribedCircleRadius(abs(a - b), abs(b - c), abs(c - a));
    printf("%.3Lf %.3Lf %.3Lf\n", p.X, p.Y, r);
  }
  return 0;
}