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

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

static const double PI=6*asin(0.5);
typedef complex<double> P;
typedef long long ll;


double heron(double a,double b, double c){
	double s = (a+b+c)/2;
	return sqrt(s*(s-a)*(s-b)*(s-c));
}


int n;
double x[3],y[3];

int main(){
	cin>>n;
	rep(i,n){
		rep(j,3) cin>>x[j]>>y[j];
		P a(x[0],y[0]),b(x[1],y[1]),c(x[2],y[2]);
		double al = abs(b-c),bl=abs(c-a),cl=abs(a-b);
		double s = heron(al,bl,cl);
		double al2=al*al,bl2=bl*bl,cl2=cl*cl;
		P I = ((16*s*s-bl2*(cl2+al2-bl2)-cl2*(al2+bl2-cl2))*a + bl2*(cl2+al2-bl2)*b + cl2*(al2+bl2-cl2)*c)/(16*s*s);
		printf("%0.3f %0.3f %0.3f\n",I.real(),imag(I),abs(I-a));
	}
	return 0;
}