#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
 
int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		double x[3], y[3], a1, a2, b1, b2, px, py, r;
		for(int i = 0; i < 3; i++){
			cin >> x[i] >> y[i];
		}
		bool check = true;
		if(y[1]-y[0] == 0){
			px = (x[1]+x[0])/2;
			check = false;
		}else{
			a1 = (x[0]-x[1])/(y[1]-y[0]);
			b1 = (y[1]+y[0])/2-a1*(x[1]+x[0])/2;
		}
		if(y[2]-y[0] == 0){
			px = (x[2]+x[0])/2;
			check = false; 
		}else{
			a2 = (x[0]-x[2])/(y[2]-y[0]);
			b2 = (y[2]+y[0])/2-a2*(x[2]+x[0])/2;
		}
		if(check){
			px = (b2-b1)/(a1-a2);
			py = a1*px+b1;	
		}else if(y[1]-y[0] == 0){
			py = a2*px+b2;
		}else if(y[2]-y[0] == 0){
			py = a1*px+b1;
		}
		r = pow(px-x[0], 2)+pow(py-y[0], 2);
		r = sqrt(r);
		cout << fixed << setprecision(3) << px << ' ' << py << ' ' << r << endl;
	}
}
