#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 dot(P a, P b) {return a.X * b.X + a.Y * b.Y;}
// 外積
D cross(P a, P b) {return a.X * b.Y - a.Y * b.X;}

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) {
  P bc = c - b, ca = a - c, ab = b - a;
  return (b + c - bc * P(0, 1) * dot(ca, ab) / cross(ca, ab)) / (D)2;
}

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;
}