#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  double a, b, c, d, e, f, px, py, r;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c >> d >> e >> f;
    py = ((e - a) * (a * a + b * b - c * c - d * d) -
          (c - a) * (a * a + b * b - e * e - f * f)) /
         (2 * (e - a) * (b - d) - 2 * (c - a) * (b - f));
    if (c != a) {
      px = (2 * (b - d) * py - a * a - b * b + c * c + d * d) / (2 * (c - a));
    } else {
      px = (2 * (b - f) * py - a * a - b * b + e * e + f * f) / (2 * (e - a));
    }
    r = hypot(px - a, py - b);
    cout << fixed << setprecision(3) << px << " " << py << " " << r << endl;
  }
}
