#include<iostream>
#include<cstdio>
#include<cmath>

using namespace std;

int main(){
	int n;
	double p,q,r;
	double x1,x2,x3,y1,y2,y3;
	
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
		p = ((((x2*x2)+(y2*y2)-(x1*x1)-(y1*y1))/(2*(x2-x1)))-2*(y2-y1)*(((x3*x3)+(y3*y3)-(x1*x1)-(y1*y1))/(2*(y3-y1)))*(1/(2*(x2-x1))))*(1/(1-(((y2-y1)*(x3-x1))/((y3-y1)*(x2-x1)))));
		q = ((((x3*x3)+(y3*y3)-(x1*x1)-(y1*y1))/(2*(y3-y1)))-2*(x3-x1)*(((x2*x2)+(y2*y2)-(x1*x1)-(y1*y1))/(2*(x2-x1)))*(1/(2*(y3-y1))))*(1/(1-(((x3-x1)*(y2-y1))/((x2-x1)*(y3-y1)))));
		r = sqrt(((x1-p)*(x1-p))+((y1-q)*(y1-q)));
		printf("%.3f %.3f %.3f\n",p,q,r);
	}
}