#include<iostream>
#include<iomanip>
#include<cmath>
int main()
{
	int n;
	std::cin >> n;
	double**result = new double*[n];
	for(int i = 0; i < n; i++)
	{
		result[i] = new double[3];
		double x1, y1, x2, y2, x3, y3;
		std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		double dx12 = x1 - x2, dx23 = x2 - x3, dx31 = x3 - x1, dy12 = y1 - y2, dy23 = y2 - y3, dy31 = y3 - y1;
		result[i][0] = (x1 * x1 * dy23 + x2 * x2 * dy31 + x3 * x3 * dy12 - dy12 * dy23 * dy31) / (x1 * dy23 + x2 * dy31 + x3 * dy12) / 2;
		result[i][1] = (y1 * y1 * dx23 + y2 * y2 * dx31 + y3 * y3 * dx12 - dx12 * dx23 * dx31) / (y1 * dx23 + y2 * dx31 + y3 * dx12) / 2;
		double dx = result[i][0] - x1, dy = result[i][1] - y1;
		result[i][2] = sqrt(dx * dx + dy * dy);
	}
	std::cout << std::fixed << std::setprecision(3);
	for(int i = 0; i < n; i++)
	{
		std::cout << result[i][0] << ' ' << result[i][1] << ' ' << result[i][2] << std::endl;
		delete[]result[i];
	}
	delete[]result;
	return 0;
}
