#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){

  double x1,x2,x3,y1,y2,y3;
  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    cin>>x1>>y1>>x2>>y2>>x3>>y3;
    double ax,ay,a,b,c,d,e,f,r;
    if(y2!=y1){
      a=-(x2-x1)/(y2-y1);
      b=-1;
      c=-a*(x1+x2)/2+(y1+y2)/2;
    }else{
      a=1;
      b=0;
      c=(x1+x2)/2;
    }
    if(y3!=y2){
      d=-(x3-x2)/(y3-y2);
      e=-1;
      f=-a*(x2+x3)/2+(y2+y3)/2;
    }else{
      d=1;
      e=0;
      f=(x2+x3)/2;
    }
    ax=(c*e-b*f)/(a*e-b*d);
    ay=(a*f-c*d)/(a*e-b*d);
    if(ax==0)
      ax=0;
    if(ay==0)
      ay=0;
    r=sqrt((x1-ax)*(x1-ax)+(y1-ay)*(y1-ay));
    if(ax*1000-(int)ax*1000>=0.5)
      ax+=0.001;
    if(ay*1000-(int)ay*1000>=0.5)
      ay+=0.001;
    printf("%.3f %.3f %.3f\n",ax,ay,r);
  }

}

  //y=a(x-a1)+b1
  //y=ax-a*a1+b1
  //ax-y=-a*a1+b1