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

int main(){
	
	int N;
	cin>>N;
	while(N--){
		double x1, x2, x3,y1, y2, y3;
		cin>>x1>>y1>>x2>>y2>>x3>>y3;
		double a, b, c, d, e, f;
		double px,py,r;
		a=2.0*(x2-x1);
		b=2.0*(y2-y1);
		c=x1*x1+y1*y1-x2*x2-y2*y2;
		d=2.0*(x3-x1);
		e=2.0*(y3-y1);
		f=x1*x1+y1*y1-x3*x3-y3*y3;
		px=(b*f-c*e)/(a*e-b*d);
		py=(c*d-a*f)/(a*e-b*d);
		r=sqrt((px-x1)*(px-x1)+(py-y1)*(py-y1));
		printf("%.3f %.3f %.3f\n",px,py,r);
	}
	
	return 0;
}
