#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <complex>
using namespace std;

#define x real()
#define y imag()
typedef complex<double> Point;

Point circumscribed_Circle_Center(Point a, Point b, Point c){
  double A = a.x - b.x;
  double B = a.y - b.y;
  double C = -1 * (a.x*a.x - c.x*c.x + a.y*a.y - b.y*b.y);
  double D = a.x - c.x;
  double E = a.y - c.y;
  double F = -1 * (a.x*a.x - c.x*c.x + a.y*a.y - c.y*c.y);

  double L = (C*E - B*F) / (E*A - B*D);
  double M = (D*C - A*F) / (D*B - E*A);
  double xp = L / -2.0;
  double yp = M / -2.0;
  return (Point(xp, yp));
}

double circumscribed_Circle_Radius(Point a, Point b, Point c){
  double A = a.x - b.x;
  double B = a.y - b.y;
  double C = -1 * (a.x*a.x - c.x*c.x + a.y*a.y - b.y*b.y);
  double D = a.x - c.x;
  double E = a.y - c.y;
  double F = -1 * (a.x*a.x - c.x*c.x + a.y*a.y - c.y*c.y);

  double L = (C*E - B*F) / (E*A - B*D);
  double M = (D*C - A*F) / (D*B - E*A);

  double N = -1 * (a.x*a.x + a.y*a.y + L*a.x + M*a.y);
  double r = sqrt(L*L + M*M - 4*N) / 2.0;
  return r;
}

int main(){
  int n;
  Point a, b, c;
  cin >> n;
  while(n--){
    cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y;
    Point C = circumscribed_Circle_Center(a, b, c);
    double r = circumscribed_Circle_Radius(a, b, c);
    printf("%0.3f %0.3f %0.3f\n", C.x, C.y, r);
  }
  return 0;
}