#include <bits/stdc++.h>

using namespace std;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n;
  cin >> n;
  for (int i = 0; i < n; i ++) {
    double a, b, c, d, e, f, px, py, r;
    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 - f) * py - a*a - b*b + e*e + f*f) / (2 * (e - a));
    } else {
      px = (2 * (b - d) * py - a*a - b*b + c*c + d*d) / (2 * (c - a));
    }
    r = sqrt((px - a) * (px - a) + (py - b) * (py - b));
    cout << fixed;
    cout << setprecision(3) << px << " " << setprecision(3) << py << " " << setprecision(3) << r << endl;
  }
}
