#include<iostream>
#include<iomanip>
#include<math.h>
using namespace std;
typedef struct POINT
{
    double x;
    double y;
}POINT;
double dist(POINT a,POINT b)
{
    return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}
bool cocircle(POINT p1,POINT p2,POINT p3,POINT &q,double &r)
{
  double x12=p2.x-p1.x;
  double y12=p2.y-p1.y;
  double x13=p3.x-p1.x;
  double y13=p3.y-p1.y;
  double z2=x12*(p1.x+p2.x)+y12*(p1.y+p2.y);
  double z3=x13*(p1.x+p3.x)+y13*(p1.y+p3.y);
  double d=2.0*(x12*(p3.y-p2.y)-y12*(p3.x-p2.x));
  //if(abs(d)<EP)                           //共&#32447;，&#22278;不存在
     //return false;
  q.x=(y13*z2-y12*z3)/d;
  q.y=(x12*z3-x13*z2)/d;
  r=dist(p1,q);
  return true;
}
int main()
{
    int n;
    double x1,x2,x3,y1,y2,y3,xp,yp,r;
    cin>>n;
    while(n--)
    {
        cin>>x1>>y1>>x2>>y2>>x3>>y3;
        POINT A,B,C,P;
        A.x=x1;
        A.y=y1;
        B.x=x2;
        B.y=y2;
        C.x=x3;
        C.y=y3;
        cocircle(A,B,C,P,r);
        cout<<fixed << setprecision(3)<<P.x<<' '<<P.y<<' '<<r<<endl;
    }

    return 0;
}