#include <iostream>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <stdio.h>

using namespace std;

//-------------------------------------------------------------------------
// geometric library

struct point {
	double x;
	double y;
};

struct circle {
	point center;
	double radius;
};

double get_distance(const point& p1, const point& p2)
{
	return sqrt(pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2));
}

point get_midpoint(const point& p1, const point& p2)
{
	point mid;
	mid.x = p1.x + p2.x / 2.0;
	mid.y = p1.y + p2.y / 2.0;
	return mid;
}

std::istream& operator >> (std::istream& is, point& p)
{
	is >> p.x >> p.y;
	return is;
}

//-------------------------------------------------------------------------
// solution

// 外接円を求める
circle get_circum_circle(const point& p1, const point& p2, const point& p3)
{
	double a = get_distance(p1, p2);
	double b = get_distance(p2, p3);
	double c = get_distance(p3, p1);
	circle result;

	// 半径の公式
	result.radius = a * b * c / sqrt((a + b + c) * (-a + b + c) * (a - b + c) * (a + b - c));

	// c,p1,p2のなす角
	double theta = acos((a / 2.0) / result.radius);

	result.center.x = p1.x + result.radius * cos(theta);
	result.center.y = p1.y + result.radius * sin(theta);

	return result;
}

circle get_circum_circle(istream& is)
{
	point p1, p2, p3;
	is >> p1 >> p2 >> p3;
	return get_circum_circle(p1, p2, p3);
}

int main(void)
{
	int num_cases;

	std::cin >> num_cases;

	for (int i = 0; i < num_cases; i++) {		
		circle result = get_circum_circle(std::cin);
		printf("%.3f %.3f %.3f\n", result.center.x, result.center.y, result.radius);
	}
	return 0;
}