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

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    double x1, y1, x2, y2, x3, y3, px, py, r;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    py = ((x3 - x1) * (x1 * x1 + y1 * y1 - x2 * x2 - y2 * y2) - (x2 - x1) * (x1 * x1 + y1 * y1 - x3 * x3 - y3 * y3)) /
         (2 * (x3 - x1) * (y1 - y2) - 2 * (x2 - x1) * (y1 - y3));
    if (x2 - x1 != 0) {
      px = (2 * (y1 - y2) * py - x1 * x1 - y1 * y1 + x2 * x2 + y2 * y2) / (2 * (x2 - x1));
    } else {
      px = (2 * (y1 - y3) * py - x1 * x1 - y1 * y1 + x3 * x3 + y3 * y3) / (2 * (x3 - x1));
    }
    r = sqrt((px - x1) * (px - x1) + (py - y1) * (py - y1));
    cout << fixed << setprecision(3) << px << " " << py << " " << r << endl;
  }
  return 0;
}
