#include <iostream>
#include <cstdio>
#include <cmath>
#define PI 3.141592653589793
using namespace std;
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		double x,x2,x3,y,y2,y3,b,c,px,py,z;
		cin>>x>>x2>>x3>>y>>y2>>y3;
		b=sqrt(pow(x3-x2,2)+pow(y3-y2,2));
		c=sqrt(pow(x-x3,2)+pow(y-y3,2));
		z=asin(b/c);
		px=((y3-y)*(x2*x2-x*x+y2*y2-y*y)+(y-y2)*(x3*x3-x*x+y3*y3-y*y))/(2*(x2-x)*(y3-y)-(y2-y)*(x3-x));
		py=((x-x3)*(x2*x2-x*x+y2*y2-y*y)+(x2-x)*(x3*x3-x*x+y3*y3-y*y))/(2*(x2-x)*(y3-y)-(y2-y)*(x3-x));
		printf("%.3lf %.3lf %.3lf\n",px/2,py/2,(b/sin(z))/2);
	}
	return 0;
}