#include <iostream>
#include <cstdio>
#include <cmath>
#include <complex>

using namespace std;
typedef complex<double> P;

int main(){
  int n;
  scanf("%d",&n);
  while(n--){
    P a,b,c;
    cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag();
    P m = (a+b)/P(2,0);
    P n = (a+c)/P(2,0);
    P s = (a-b)*P(0,1);
    P t = (a-c)*P(0,1);
    double e = (t.imag()+s.real())/(conj(s)*t).imag();
    P o = m+s*P(e,0);
    double r = abs(a-o);
    printf("%.3f %.3f %.3f",o.real(),o.imag(),r);
  }
}