#include<iostream>
#include<vector>
#include<complex>
using namespace std;    

typedef complex<double> P;

double cross(P a, P b){
  return (a.real()*b.imag() - a.imag()*b.real());
}

int main()
{
  int i,j;
  int n;
  P point[3],ans;

  cin >> n;
  for(i=0;i<n;i++){

    for(j=0;j<3;j++){
      cin >> point[j].real() >> point[j].imag();
    }

    P p01 = point[0] + point[1];
    P p12 = point[1] + point[2];
    P p012 = P(p01.real()/2 , p01.imag()/2);
    P p122 = P(p12.real()/2 , p12.imag()/2);
    P n1 = (point[0] - p012) * P(0,1) + p012;
    P n2 = (point[1] - p122) * P(0,1) + p122;

    ans = n1 + (p012-n1) * cross(p122-n2,n2-n1) / cross(p122-n2,p012-n1);
    cout.precision(4);
    cout << showpoint << real(ans) << " " << imag(ans) << " " << abs(point[0]-ans) << endl;
  }
  return 0;
}
    