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

double l(double x1, double y1, double x2, double y2){
	return sqrt(pow((x1-x2),2) + pow((y1-y2),2));
}

void solve(double x1, double y1, double x2, double y2, double x3, double y3){
	double a,b,c,ans_x,ans_y,ans_r;
	a = l(x1, y1, x2, y2);
	b = l(x1, y1, x3, y3);
	c = l(x2, y2, x3, y3);
	double A,B,C;
	A=a*a;
	B=b*b;
	C=c*c;
	
	double s = (a+b+c)/2.0;
	double S = sqrt(s*(s-a)*(s-b)*(s-c));
	double largeSd = S*S;
	ans_x = A/4.0*(B+C-A)/4.0*x1/largeSd + B/4.0*(C+A-B)/4.0*x2/largeSd + C/4.0*(A+B-C)/4.0*x3/largeSd;
	ans_y = A/4.0*(B+C-A)/4.0*y1/largeSd + B/4.0*(C+A-B)/4.0*y2/largeSd + C/4.0*(A+B-C)/4.0*y3/largeSd;
	
	ans_r = l(x1, y1, ans_x, ans_y);
	printf("%4.3f %4.3f, %4.3f\n",ans_x, ans_y, ans_r);
}

int main(){
	int n;
	cin >> n;
	double x1[n],y1[n],x2[n],y2[n],x3[n],y3[n];
	for(int i = 0; i < n; i++){
		cin >> x1[i] >> y1[i] >> x2[i] >> y2[i] >> x3[i] >> y3[i];
	}
	for(int i = 0; i < n; i++){
		solve(x1[i], y1[i], x2[i], y2[i], x3[i], y3[i]);
	}
}