#include<string>
#include<vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<functional>
#include<map>
#include<set>
#include<cmath>
#include<iomanip>

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

using namespace std;

int main(){

	int n;
	cin >> n;

	double x1,y1,x2,y2,x3,y3;
	rep(i,n){

	cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

	double a=x2*x2-x1*x1+y2*y2-y1*y1;
	double b=x3*x3-x1*x1+y3*y3-y1*y1;
	double c=4*(x2-x1)*(y3-y1)-4*(x3-x1)*(y2-y1);

	double xp=(2*(y3-y1)*a-2*(y2-y1)*b)/c;
	double yp=(-2*(x3-x1)*a+2*(x2-x1)*b)/c;
	double r=sqrt((xp-x1)*(xp-x1)+(yp-y1)*(yp-y1));

    cout << fixed;
    cout.precision(3);
	cout << (int)(1000.0*xp+0.5)/1000.0 << " " << (int)(1000.0*yp+0.5)/1000.0 << " " << (int)(1000.0*r+0.5)/1000.0 << endl;

	}


	return 0;
}