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

using namespace std;

struct point {
	double x;
	double y;
};

struct circle {
	point center;
	double radius;
};

struct line { // ax + by + c = 0
	double a;
	double b;
	double c;
};

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

bool operator == (const point& p1, const point& p2)
{
	return p1.x == p2.x && p1.y == p2.y;
}

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

bool get_crosspoint(const line& l1, const line& l2, point *result)
{
	double denominator = l1.a * l2.b - l1.b * l2.a;
	if (denominator == 0) {
		return false;
	}
	result->x = (l1.b * l2.c - l2.b * l1.c) / denominator;
	result->y = (l2.a * l1.c - l1.a * l2.c) / denominator;
	return true;
}

bool get_bisector(const point& p1, const point& p2, line *result)
{
	if (p1 == p2) {
		return false;
	}
	result->a = 2 * (p1.x - p2.x);
	result->b = 2 * (p1.y - p2.y);
	result->c = -(p1.y - p2.y) * (p1.y + p2.y) - (p1.x - p2.x) * (p1.x + p2.x);
	return true;
}

bool get_circum_circle(const point& p1, const point& p2, const point& p3, circle *result)
{
	double a = get_distance(p1, p2);
	double b = get_distance(p2, p3);
	double c = get_distance(p3, p1);

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

	line line_p1p2;
	line line_p2p3;

	// 頂点の垂直2等分線の交点が外心
	return get_bisector(p1, p2, &line_p1p2) &&
		   get_bisector(p2, p3, &line_p2p3) &&
		   get_crosspoint(line_p1p2, line_p2p3, &result->center);
}

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

	get_circum_circle(p1, p2, p3, &result);
	return result;
}

int main(void)
{
	int n;

	std::cin >> n;

	while (n--) {
		circle c = get_circum_circle(std::cin);
		printf("%.3f %.3f %.3f\n", c.center.x, c.center.y, c.radius);
	}
	return 0;
}
