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

int w(int n)
{
  return n * n;
}

int main()
{
  double x1, y1, x2, y2, x3, y3;
  int n;
  double a, b, c;
  double px, py, r;

  cin >> n;

  for (int i = 0; i < n; i++){
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

    a = sqrt(w(x1 - x2) + w(y1 - y2));
    b = sqrt(w(x2 - x3) + w(y2 - y3));
    c = sqrt(w(x3 - x1) + w(y3 - y1));
    px = ((y1 - y3) * (w(y1) - w(y2) + w(x1) - w(x2)) - (y1 - y2) * (w(y1) - w(y3) + w(x1) - w(x3))) / (2 * (y1 - y3) * (x1 - x2) - 2 * (y1 - y2) * (x1 - x3));
    py = ((x1 - x3) * (w(x1) - w(x2) + w(y1) - w(y2)) - (x1 - x2) * (w(x1) - w(x3) + w(y1) - w(y3))) / (2 * (x1 - x3) * (y1 - y2) - 2 * (x1 - x2) * (y1 - y3));
    //r = (a * b * c) / sqrt((a + b + c) * (b + c - a) * (a - b + c) * (a + b - c));
    x = ((a*a)-((b*b)+(c*c)))/(-2*b*c);
    y = sqrt(1-x*x);
    r = a/(2*y);
    printf("%.3f %.3f %.3f\n", px, py, r);
  }

  return 0;
}