#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
#define ep 0.00001

int main()
{
	double a, b, c, d, p, q;
	double x1, y1, x2, y2, x3, y3;
	double x, y, r;
	double det;
	int n;
	
	/*
	(x - x1)^2 + (y - y1)^2 = (x - x3)^2 + (y - y3)^2
	(x - x2)^2 + (y - y2)^2 = (x - x3)^2 + (y - y3)^2
	
	2(x3 - x1)x + 2(y3 - y1)y = (x3)^2 + (y3)^2 - (x1)^2 - (y1)^2
	2(x3 - x2)x + 2(y3 - y2)y = (x3)^2 + (y3)^2 - (x2)^2 - (y2)^2
	*/
	
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		a = 2 * (x3 - x1);
		b = 2 * (y3 - y1);
		c = 2 * (x3 - x2);
		d = 2 * (y3 - y2);
		p = x3 * x3 + y3 * y3 - x1 * x1 - y1 * y1;
		q = x3 * x3 + y3 * y3 - x2 * x2 - y2 * y2;
		
		det = a * d - b * c;
		x = (d * p - b * q) / det + ep;
		y = (a * q - c * p) / det + ep;
		
		r = hypot(x - x1, y - y1);
		printf("%.3f %.3f %.3f\n", x, y, r);
	}
	return 0;
}