#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	//cin.tie(0);
	//ios::sync_with_stdio(false);
	
	int N=in();
	REP(i,N){
		double x1,y1,x2,y2,x3,y3;
		cin>>x1>>y1>>x2>>y2>>x3>>y3;

		double a=hypot(x2-x3,y2-y3);
		double b=hypot(x1-x3,y1-y3);
		double c=hypot(x2-x1,y2-y1);
		double coeff1 = a*a*(b*b+c*c-a*a);
		double coeff2 = b*b*(a*a+c*c-b*b);
		double coeff3 = c*c*(b*b+a*a-c*c);

		double x = (coeff1*x1+coeff2*x2+coeff3*x3)/(coeff1+coeff2+coeff3);
		if(abs(x)<=1e-7) x=0;
		double y = (coeff1*y1+coeff2*y2+coeff3*y3)/(coeff1+coeff2+coeff3);
		if(abs(y)<=1e-7) y=0;
		double r = hypot(x-x1,y-y1);
		
		printf("%.3lf %.3lf %.3lf\n",round(x*1000)/1000,round(y*1000)/1000,round(r*1000)/1000);
	}

	return 0;
}
