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

int main() {
  int n;
  double a, b, c, d, e, f, px, py, r;
  cin >> n;
  while (cin >> a >> b >> c >> d >> e >> f) {
    double aa = a * a;
    double bb = b * b;
    double cc = c * c;
    double dd = d * d;
    double ee = e * e;
    double ff = f * f;
    py = ((e - a) * (aa + bb - cc - dd) - (c - a) * (aa + bb - ee - ff)) /
         (2 * (e - a) * (b - d) - 2 * (c - a) * (b - f));
    if (c == a) {
      px = (2 * (b - f) * py - aa - bb + ee + ff) / (2 * (e - a));
    } else {
      px = (2 * (b - d) * py - aa - bb + cc + dd) / (2 * (c - a));
    }
    r = sqrt((px - a) * (px - a) + (py - b) * (py - b));
    cout << fixed << setprecision(3) << px << " " << py << " " << r << "\n";
  }
  return 0;
}
