#include <cstdio>
#include <cmath>
#include <utility>
using namespace std;

struct Line {
  double a;
  double b;
  double c;
};

typedef pair<double, double> Pair;

int n;
double xs[3];
double ys[3];

double Dist(Pair p1, Pair p2) {
  double dx = p1.first - p2.first;
  double dy = p1.second - p2.second;
  return sqrt(dx*dx+dy*dy);
}

Pair Intersect(Line &l1, Line &l2) {
  double a1 = l1.a;
  double b1 = l1.b;
  double c1 = l1.c;
  double a2 = l2.a;
  double b2 = l2.b;
  double c2 = l2.c;
  double x = (b1*c2 - b2*c1)/(a1*b2-a2*b1);
  double y = (a1*c2 - a2*c1)/(a2*b1-a1*b2);
  return Pair(x, y);
}

int main() {
  scanf("%d", &n);
  while (n--) {
    for (int i=0; i<3; i++) {
      scanf("%lf%lf", &xs[i], &ys[i]);
    }

    Line l1, l2;
    l1.a = xs[1]-xs[0];
    l1.b = ys[1]-ys[0];
    l1.c = -(xs[1]*xs[1]-xs[0]*xs[0] + ys[1]*ys[1]-ys[0]*ys[0])/2;
    l2.a = xs[1]-xs[2];
    l2.b = ys[1]-ys[2];
    l2.c = -(xs[1]*xs[1]-xs[2]*xs[2] + ys[1]*ys[1]-ys[2]*ys[2])/2;
    Pair p = Intersect(l1, l2);
    double r = Dist(p, Pair(xs[0], ys[0]));
    p.first = int(p.first*1000)/1000.0;
    p.second = int(p.second*1000)/1000.0;
    r = int(r*1000)/1000.0;
    printf("%.3f %.3f %.3f\n", p.first, p.second, r);
  }
}