#include <iostream>
#include <cmath>
#include <cstdio>
#include <cassert>
using namespace std;
typedef pair<double, double> PDD;
PDD calc(double mat[2][2], double vec[2]){
  double a = mat[0][0], b = mat[0][1], d = mat[1][0], e = mat[1][1];
  double c = vec[0], f = vec[1];
  double det = a * e - d * b;
  return make_pair((e * c - b * f) / det, (-c * d + a * f) / det);
}
int main(){
  int Tc;
  cin >> Tc;
  for(int tc = 0; tc < Tc; ++tc){
    double x1, y1, x2, y2, x3, y3;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    double A, B, C, D, E, F;
    A = (y1 + y3) / 2.;
    B = (x1 - x3) / (y1 - y3);
    C = (x1 + x3) / 2.;
    D = (y2 + y3) / 2.;
    E = (x2 - x3) / (y2 - y3);
    F = (x2 + x3) / 2.;
    double mat[2][2];
    mat[0][0] = B; mat[0][1] = 1;
    mat[1][0] = E; mat[1][1] = 1;
    double vec[2];
    vec[0] = A + B * C;
    vec[1] = D + E * F;
    PDD res = calc(mat, vec);
    double x = res.first, y = res.second;
    assert(x==x); assert(y==y);
    double r = pow((x-x1)*(x-x1)+(y-y1)*(y-y1), 0.5);
    x = (double)(round(x*1000))/1000.0;
    y = (double)(round(y*1000))/1000.0;
    r = (double)(round(r*1000))/1000.0;    
    x = (x == -0.0) ? 0.0 : x;
    y = (y == -0.0) ? 0.0 : y;
    printf("%.3f %.3f %.3f\n", x, y, r);
  }
  return 0;
}