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

int main() {
  int n;
  double x1, y1, x2, y2, x3, y3;
  double a1, b1, c1, a2, b2, c2;
  double x, y, r;
  cin >> n;
  while (n--) {
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    a1 = x2-x1;
    b1 = y2-y1;
    c1 = -a1*(x1+x2)*0.5 - b1*(y1+y2)*0.5;
    
    a2 = x3-x2;
    b2 = y3-y2;
    c2 = -a2*(x2+x3)*0.5 - b2*(y2+y3)*0.5;

    y = (a2*c1-a1*c2)/(a1*b2-a2*b1);
    if (a1) {
      x = -(b1*y+c1)/a1;
    } else {
      x = -(b2*y+c2)/a2;
    }
    r = sqrt((x1-x)*(x1-x) + (y1-y)*(y1-y));

    cout.setf(ios::fixed);
    cout.precision(3);
    cout << x << " " << y << " " << r << endl;
  }
}