#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>

using namespace std;

int main()
{

	int n;
	double a,b,c,d,e,f,x1,x2,x3,y1,y2,y3;
	double ans_x,ans_y,ans_r;

	cin>>n;

	for(int i=0;i<n;i++){

		cin>>x1>>y1>>x2>>y2>>x3>>y3;


		if(y1==y2){
			ans_x=(x1+x2)/2.0;
			a=-(x3-x2)/(y3-y2);
			b=(x2+x3)/2.0; c=(y2+y3)/2.0;
		}else if(y2==y3){
			ans_x=(x2+x3)/2.0;
			a=-(x2-x1)/(y2-y1);
			b=(x1+x2)/2.0; c=(y1+y2)/2.0;
		}else{
			a=-(x3-x2)/(y3-y2);
			b=(x2+x3)/2.0; c=(y2+y3)/2.0;
			d=-(x2-x1)/(y2-y1);
			e=(x1+x2)/2.0; f=(y1+y2)/2.0;
			
			ans_x=(a*b-d*e-c+f);
		}

		ans_y=a*(ans_x-b)+c;
		ans_r=sqrt( (x1-ans_x)*(x1-ans_x) + (y1-ans_y)*(y1-ans_y) );

		printf("%.3f %.3f %.3f\n",ans_x,ans_y,ans_r);

	}

	return 0;

}