#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
main(){
	int data;
	cin>>data;
	for(int r=1;r<=data;++r){
		double x1,x2,x3,y1,y2,y3,d,x,y,r;
		cin>>x1>>y1>>x2>>y2>>x3>>y3;
		d=4*(x3-x2)*(y2-y1)-4*(y3-y2)*(x2-x1);
		x=2*(x3*x3-x2*x2+y3*y3-y2*y2)*(y2-y1)-2*(y3-y2)*(x2*x2-x1*x1+y2*y2-y1*y1);
		y=2*(x3-x2)*(x2*x2-x1*x1+y2*y2-y1*y1)-2*(x3*x3-x2*x2+y3*y3-y2*y2)*(x2-x1);
		x2=x/d;
		y2=y/d;
		r=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
		printf("%.3f %.3f %.3f\n",x2,y2,r);
	}
}