#include <iostream>
#include <vector>
#include <math.h>
#include <cstdio>
#include <algorithm>
using namespace std;

double renritux(double a,double b,double c,double d,double e,double f) 
{

	double x;	

		if (a==0){
			x = (f - (e*c/b)) / d;
		}else if(b==0){
			x = c / a;
		}else if(d==0){
			x = (c - (b*f/e)) / a;
		}else if(e==0){
			x = f / d;
		}else{
			x = (f - (e*c/b)) / (d - (e*a/b));
		}
		if (x==-0) x=0;
		
	return x;
  
}

double renrituy(double a,double b,double c,double d,double e,double f) 
{

	double y;	

		if (a==0){
			y = c / b;
		}else if(b==0){
			y = (f - (d*c/a)) / e;
		}else if(d==0){
			y = f / e;
		}else if(e==0){
			y = (c - (a*f/d)) / b;
		}else{
			y = (f - (d*c/a)) / (e - (d*b/a));
		}
		if (y==-0) y=0;
		
	return y;
  
}

double distance(double x1,double y1,double x2,double y2)
{
 
    vector<double> x,y;
    double dist;
    
    x.push_back(x1);
    y.push_back(y1);
    x.push_back(x2);
    y.push_back(y2);
     
    sort(x.begin(),x.end());
    sort(y.begin(),y.end());
     
    dist = sqrt((x[1]-x[0])*(x[1]-x[0])+(y[1]-y[0])*(y[1]-y[0]));
     
    return dist;
    
}

int main() {
	int n;
	cin >>n;
	
	for(int i=0;i<n;i++){
		double x1,y1,x2,y2,x3,y3,px,py,r,a,b,c,d,e,f;
		cin >>x1>>y1>>x2>>y2>>x3>>y3;
		
		if (y2!=y1){
			a = (x2-x1)/(y2-y1);
			b = 1;
			c = (x1+x2)*(x2-x1)/(2*(y2-y1)) + (y1+y2)/2;
		}else{
			a = 1;
			b = 0;
			c = (x1+x2)/2;
		}
		
		if (y3!=y1){
			d = (x3-x1)/(y3-y1);
			e = 1;
			f = (x1+x3)*(x3-x1)/(2*(y3-y1)) + (y1+y3)/2;
		}else{
			d = 1;
			e = 0;
			f = (x1+x3)/2;
		}
		px = renritux(a,b,c,d,e,f);
	  	py = renrituy(a,b,c,d,e,f);
	  	
	  	r = distance(px,py,x1,y1);
	  	
		printf("%.3f %.3f %.3f\n",px,py,r);
	
	}	
	return 0;
  
}