#include <iostream>
#include <complex>
#include <vector>
#include <cstdio>
using namespace std;

const double EPS = 1e-8;
const double INF = 1e12;
typedef complex<double> P;

bool operator < (const P& a, const P& b) {
  return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
}

double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}
struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
};

L caln(P a, P b) {
  return L((a+b)*P(0.5,0), (a+b)*P(0.5,0) + (b-a)*P(0, 1));
}

P intersect(L a, L b) {
  P aa(a[1]-a[0]), bb(b[1]-b[0]);
  return a[0] + aa * cross(bb, b[0]-a[0]) / cross(bb, aa);
}

int main() {
  int n;
  cin >> n;
  while(n--) {
    double x1,y1,x2,y2,x3,y3;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    P a1(x1,y1), a2(x2,y2), a3(x3,y3);
    P ans = intersect(caln(a1,a2), caln(a2,a3));
    printf("%.3f %.3f %.3f\n", real(ans),imag(ans),abs(a1-ans));
  }
}