#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <complex>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)
typedef complex<double> P;
typedef long long ll;

int n;
double x[3],y[3];
double px,py,r;

double in_pro(P a,P b){
	return a.real()*b.real()-a.imag()*b.imag();
}

double squ(P a, P b){
	double s = (a.real()*b.imag()-a.imag()*b.real())/2;
	if(s<0) s*=-1;
	return s;
}


int main(){
	cin>>n;
	rep(i,n){
		rep(i,3){
			cin>>x[i]>>y[i];
		}
		P a(x[1]-x[0],y[1]-y[0]), b(x[2]-x[0],y[2]-y[0]);
		double alen = abs(a),blen = abs(b);
		alen*=alen; blen*=blen;
		double inp = in_pro(a,b);
		double s = squ(a,b);
		//P I=(inp-alen*alen)/(inp*inp-alen*alen)*a + (inp-blen*blen)/(inp*inp-blen*blen)*b;
		P I=(blen*(alen-inp)*a + alen*(blen-inp)*b)/((alen*blen-inp*inp)*2);
		//cout<<alen<<" "<<blen<<" "<<inp<<endl;
		
		printf("%0.3f %0.3f %0.3f\n",I.real()+x[0],I.imag()+y[0],abs(I));
		}
	return 0;
	
}
	