#include <iostream>
#include <stdio.h>
#include <string>
#include <queue>
#include <cmath>

#define int64 long long int

using namespace std;

int main()
{
	int n;
	double x1,y1,x2,y2,x3,y3,x,y,r;
	double det,a1,b1,a2,b2,c1,c2;
	cin >> n;
	for(int i=0; i<n; i++){
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		a1 = 2 * (x1 - x2), b1 = 2 * (y1 - y2);
		a2 = 2 * (x2 - x3), b2 = 2 * (y2 - y3);
		det = a1 * b2 - a2 * b1;
		c1 = (x1*x1 - x2*x2) + (y1*y1 - y2*y2);
		c2 = (x2*x2 - x3*x3) + (y2*y2 - y3*y3);
		x = (a1 * c1 + b1 * c2) / det;
		y = (a2 * c1 + b2 * c2) / det;
		r = sqrt((x - x1)*(x - x1) + (y - y1)*(y - y1));
		if(fabs(x) < 1e-6) x = 0.0;
		if(fabs(y) < 1e-6) y = 0.0;
		printf("%.3f %.3f %.3f\n", x, y, r);
	}
	return 0;
}