#include <iostream>
#include <cstdio>
#include <stdio.h>
#include <math.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		double x1,y1,x2,y2,x3,y3,xp,yp,r;
		cin>>x1>>y1>>x2>>y2>>x3>>y3;
		double a=x2-x1,b=y2-y1,c=x3-x1,d=y3-y1;
		if(a==0){
			xp = c/2+d/2/c-b*d/2/c;
			yp = b/2;
		}else if(b==0){
			xp = a/2;
			yp = -a*c/2/d+c*c/2/d+d/2;
		}else if(c==0){
			xp = a/2+b/2/a-d*b/2/a;
			yp = d/2;
		}else if(d==0){
			xp = c/2;
			yp = -a*c/2/b+a*a/2/b+b/2;
		}else{
			xp = (d*(a*a+b*b)-b*(c*c+d*d))/(a*d-b*c)/2;
			yp = -a*xp/b+a*a/2/b+b/2;
		}
		r = sqrt((x1-xp)*(x1-xp)+(y1-yp)*(y1-yp));
		printf("%.3lf %.3lf %.3lf\n",xp,yp,r);
	}
	return 0;
}