#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;

int main(){
	double n,a,b,c,d,e,f,x,y,r;
	
	cin >> n ;
	for(int turn=0;turn<n;turn++){
		cin >> a >> b >> c >> d >> e >> f;
		x=((c-a)*(e*e+f*f-a*a-b*b)-(e-a)*(c*c+d*d-a*a-b*b))/(2*((f-b)*(c-a)-(e-a)*(d-b)));
		y=((f-b)*(c*c+d*d-a*a-b*b)-(d-b)*(e*e+f*f-a*a-b*b))/(2*((f-b)*(c-a)-(e-a)*(d-b)));
		
		r=sqrt((x-a)*(x-a)+(y-b)*(y-b));
		
		printf("%.3f %.3f %.3f\n",x,y,r);
	}
return 0;
}