
#include<iostream>
#include<math.h>
using namespace std;

int main()
{
    int n;
    int x1,x2,x3,y1,y2,y3;
    cin>>n;
    while(n--)
    {
        double x,y,r,dx,dy;
        cin>>x1>>y1>>x2>>y2>>x3>>y3;
        dx=(x2+x3-2*x1)/2;
        dy=(y2+y3-2*y1)/2;
        x=x1+dx;
        y=y1+dy;
        r=sqrt(dx*dx+dy*dy);
        printf("%.3f %.3f %.3f\n",x,y,r);
    }
    return 0;
}