#include <iostream>
#include <stdio.h>

void CulculateCoordinateAndRadius(double&, double&, double&, double, double, double, double, double, double);
double slope(const double[2], const double[2]);
double n_slope(const double[2], const double[2]);
double intercept(const double, const double[2]);
double center(const double, const double);
double mySqrt(double, const int&);
double myRound(double, const int&);

int main(){

	int NumberOfDataset;  //データセットの数
	double x1, y1, x2, y2, x3, y3; //入力される座標
	double px, py, r;

	std::cin >> NumberOfDataset;

	for (int i = 0; i < NumberOfDataset; i++)
	{
		std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		CulculateCoordinateAndRadius(px, py, r, x1, y1, x2, y2, x3, y3);
		/*px = myRound(px, 4);
		py = myRound(py, 4);
		r = myRound(r, 4);*/
		//std::cout << px << ' ' << py << ' ' << r << std::endl;
		printf("%0.3f %0.3f %0.3f\n", px, py, r);
	}
}

void CulculateCoordinateAndRadius(double& px, double&py, double&r, double x1, double y1, double x2, double y2, double x3, double y3){
	double point1[2] = { x1, y1 };
	double point2[2] = { x2, y2 };
	double point3[2] = { x3, y3 };
	double center1[2] = { center(point1[0], point2[0]), center(point1[1], point2[1]) };
	double center2[2] = { center(point2[0], point3[0]), center(point2[1], point3[1]) };
	double n_slope_1 = n_slope(point1, point2);
	double n_slope_2 = n_slope(point2, point3);
	double intercept_1 = intercept(n_slope_1, center1);
	double intercept_2 = intercept(n_slope_2, center2);
	if (y1 == y2){
		px = center1[0];
		py = n_slope_2 * px + intercept_2;
	}
	else if (y2 == y3){
		px = center2[0];
		py = n_slope_1 * px + intercept_1;
	}else{
		px = (intercept_2 - intercept_1) / (n_slope_1 - n_slope_2);
		py = n_slope_1 * px + intercept_1;
	}
	r = mySqrt((px - x1) * (px - x1) + (py - y1) * (py - y1), 5);
}


double slope(const double point1[2], const double point2[2]){
	return (point2[1] - point1[1]) / (point2[0] - point1[0]);
}

double n_slope(const double point1[2], const double point2[2]){
	double x1 = -point1[1];
	double y1 = point1[0];
	double x2 = -point2[1];
	double y2 = point2[0];
	return (y2 - y1) / (x2 - x1);
}

double intercept(const double slope, const double POINT1[2]){
	return -slope * POINT1[0] + POINT1[1];
}

double center(const double COODINATE1, const double COODINATE2){
	return (COODINATE1 + COODINATE2) / 2;
}

double mySqrt(double number, const int& SIGNIFICANT_DIGITS){
	double result = 0;
	double digitsOffset = 1;

	for (int i = 0; i < SIGNIFICANT_DIGITS + 1; i++){
		while (number >= (result + digitsOffset) * (result + digitsOffset)){
			result += digitsOffset;
		}
		digitsOffset /= 10;
	}
	return result;
}

double myRound(double number, const int& SIGNIFICANT_DIGITS){
	for (int i = 0; i < SIGNIFICANT_DIGITS; i++){
		number *= 10;
	}
	int targetDigits = static_cast<int>(number) % 10;
	if (targetDigits >= 5){
		number = static_cast<int>(number) + 10 - targetDigits;
	}
	else{
		number = static_cast<int>(number) - targetDigits;
	}
	for (int i = 0; i < SIGNIFICANT_DIGITS; i++){
		number /= 10;
	}
	return number;
}
