#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main(){
  int n;
  double x[3],y[3];
  cin >> n;
  for(int i=0;i<n;i++){
    for(int i=0;i<3;i++) cin >> x[i] >> y[i];
    double a1 = 2 * (x[1] - x[0]);
    double b1 = 2 * (y[1] - y[0]);
    double c1 = x[0] * x[0] - x[1] * x[1] + y[0] * y[0] - y[1] * y[1];
    double a2 = 2 * (x[2] - x[0]);
    double b2 = 2 * (y[2] - y[0]);
    double c2 =  x[0] * x[0] - x[2] * x[2] + y[0] * y[0] - y[2] * y[2];
    double ansx = (b1*c2-b2*c1)/(a1*b2-a2*b1);
    double ansy = (c1*a2-c2*a1)/(a1*b2-a2*b1);
    double ans = sqrt((ansx-x[0])*(ansx-x[0])+(ansy-y[0])*(ansy-y[0]));
    cout << fixed << setprecision(3) << ansx << ' ' << ansy << ' ' << ans << endl;
  }
  return 0;
}