#include <bits/stdc++.h>
using namespace std;

#define FOR(i,l,r) for(int i = (l);i < (r);i++)
#define ALL(x) (x).begin(),(x).end()
template<typename T> bool chmax(T& a,const T& b){return a < b ? (a = b,true) : false;}
template<typename T> bool chmin(T& a,const T& b){return b < a ? (a = b,true) : false;}
typedef long long ll;

int N;
pair<double,double> A,B,C;
const double EPS = 1e-6,INF = 1e9;

double dist(pair<double,double> a,pair<double,double> b)
{
	double x = a.first - b.first,y = a.second - b.second;
	return sqrt(x * x + y * y);
}

int main()
{
	scanf("%d",&N);
	FOR(i,0,N){
		scanf("%lf%lf%lf%lf%lf%lf",&A.first,&A.second,&B.first,&B.second,&C.first,&C.second);
		pair<double,double> x((A.first + B.first) / 2.0,(A.second + B.second) / 2.0);
		pair<double,double> y((A.first + C.first) / 2.0,(A.second + C.second) / 2.0);
		pair<double,double> ans(INF,INF);
		double p = INF,q = INF,r = INF,s = INF;
		if(abs(A.second - B.second) < EPS){
			ans.first = x.first;
		}
		else{
			p = - (A.first - B.first) / (A.second - B.second);
			q = x.second - x.first * p;
		}
		if(abs(A.second - C.second) < EPS){
			ans.first = y.first;
		}
		else{
			r = - (A.first - C.first) / (A.second - C.second);
			s = y.second - y.first * r;
		}
		assert(p != r);
		if(ans.first == INF){
			ans.first = (s - q) / (p - r);
		}
		if(p != INF){
			ans.second = p * ans.first + q;
		}
		else{
			ans.second = r * ans.first + s;
		}
		printf("%.3f %.3f %.3f\n",ans.first,ans.second,dist(A,ans));
	}

	return 0;
}