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

double a,b,c,d,e,f,x,y,r;
int n;

double ifof(double a){
	int n = a*10000;
	if(n%10 >= 5)
		n++;
	return n/10000.0;
}

double solvex(){
	double k,l;
	k = (c*c)-(a*a)+(d*d)-(b*b)-(2*y*(d-b));
	l = 2*(c-a);
	return k/l;
}

double solvey(){
	double k,l;
	k = ((e-a)*((c*c)-(a*a)+(d*d)-(b*b)))-((c-a)*((e*e)-(a*a)+(f*f)-(b*b)));
	l = 2*(((d-b)*(e-a))-((f-b)*(c-a)));
	return k/l;
}

int main(){
	std::cin >> n;
	for(int i=0; i<n; i++){
		std::cin >> a >> b >> c >> d >> e >> f;
		y = solvey();
		x = solvex();
		r = std::sqrt(((x-a)*(x-a)) + ((y-b)*(y-b)));
		std::printf("%.3f %.3f %.3f\n",ifof(x),ifof(y),ifof(r));
	}
	return 0;
}