/*Filename: aoj0010.cpp
 *Author: Mushiyo
 */

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

using namespace std;

struct Point {
	double x;
	double y;
};

double countDist(Point a, Point b) {
	int xDist = abs(a.x - b.x);
	int yDist = abs(a.y - b.y);

	return sqrt(xDist * xDist + yDist * yDist);
}

Point getCircumCircleCenter(Point a, Point b, Point c) {
	Point bias = a;
	a.x = 0;
	a.y = 0;
	b.x -= bias.x;
	b.y -= bias.y;
	c.x -= bias.x;
	c.y -= bias.y;

	Point center;
	center.y = bias.y + ((c.x * c.x + c.y * c.y) * b.x - (b.x * b.x + b.y * b.y) * c.x)
			/ (2 * (b.x * c.y - c.x * b.y));
	center.x = bias.x + (-2 * center.y * b.y + b.x * b.x + b.y * b.y) / (2 * b.x);

	return center;
}

int main() {
	int n;

	while (cin >> n) {
		while (n > 0) {
			Point a, b, c;
			cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y;

			Point center = getCircumCircleCenter(a, b, c);
			double radius = countDist(center, a);

			printf("%.3f %.3f %.3f\n", center.x, center.y, radius);

			--n;
		}
	}

	return 0;
}