#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;

const double EPS = 1e-5;

double dist(double x1, double y1, double x2, double y2) {
  return sqrt(pow(x2-x1, 2) + pow(y2-y1, 2));
}

int main() {
  int n;
  double x[3], y[3], a, b, c, sa, ca;
  double px, py, r;
  cin >> n;
  for (int k=0;k<n;k++) {
    for (int i=0;i<3;i++) {
      cin >> x[i] >> y[i];
    }
    a = dist(x[1], y[1], x[2], y[2]);
    b = dist(x[0], y[0], x[1], y[1]);
    c = dist(x[0], y[0], x[2], y[2]);
    ca = (a*a - b*b - c*c) / (2*b*c);
    sa = sqrt(1 - ca*ca);
    r = a / sa / 2;

    for (px=-r;px<=r;px+=0.000001) {
      py = sqrt(r*r - px*px);
      if (abs(pow(px-x[0], 2) + pow(py-y[0], 2) - r*r) < EPS &&
          abs(pow(px-x[1], 2) + pow(py-y[1], 2) - r*r) < EPS &&
          abs(pow(px-x[2], 2) + pow(py-y[2], 2) - r*r) < EPS) {
        break;
      }
    }
    printf("%.3f %.3f %.3f\n", px, py, r);
  }
  return 0;
}