#include <cstdio>
#include <iostream>
#include <complex>

using namespace std;

const double EPS = 1e-8;
const double INF = 1e12;
typedef complex<double> P, point;

point three_point_circle(const point& a, const point& b, const point& c) {
  point x = 1.0/conj(b - a), y = 1.0/conj(c - a);
  return (y-x)/(conj(x)*y - x*conj(y)) + a;
}

int main()
{
	int n;

	cin >> n;
	for (int i = 0; i < n; i++){
		point points[3];
		for (int j = 0; j < 3; j++){
			double x, y;
			cin >> x >> y;
			points[j] = point(x, y);
		}
		point center = three_point_circle(points[0], points[1], points[2]);
		printf("%.3f %.3f %.3f\n", real(center), imag(center), abs(center - points[0]));
	}
}