#include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <ctime>
#include <iterator>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

int main()
{
    int nb_cas;
    cin>>nb_cas;
    while(nb_cas--)
    {
        double x1,y1,x2,y2,x3,y3;
        cin>>x1>>y1>>x2>>y2>>x3>>y3;
        double a1=(x2-x1)*2;
        double b1=(y2-y1)*2;
        double c1=x1*x1-x2*x2+y1*y1-y2*y2;
        double a2=(x3-x1)*2;
        double b2=(y3-y1)*2;
        double c2=x1*x1-x3*x3+y1*y1-y3*y3;
        double xc=(b1*c2-b2*c1)/(a1*b2-a2*b1);
        double yc=(c1*a2-c2*a1)/(a1*b2-a2*b1);
        double r=sqrt((x1-xc)*(x1-xc)+(y1-yc)*(y1-yc));
        cout<<fixed<<setprecision(3)<<xc<<" "<<yc<<" "<<r<<endl;
    }
}