#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+=10;
	else if(n%10 <= -5)
		n-=10;
	return n/10000.0;
}

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

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

int main(){
	std::cin >> n;
	for(int i=0; i<n; i++){
		std::cin >> a >> b >> c >> d >> e >> f;
		x = solvex();
		y = solvey();
		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;
}