#include	<iostream>
#include	<cstdio>
#include	<cmath>

using namespace std;

int main(void) {
	int ds;
	
	cin >> ds;
	
	for(int i = 0; i < ds; i++) {
		cin.ignore();
		double X[3] = { 0 };
		double Y[3] = { 0 };
		double ans[3] = { 0 };
		
		double a1, b1, c1, a2, b2, c2;
		
		for(int j = 0; j < 3; j++) {
			cin >> X[j] >> Y[j];
		}
		
		a1 = 2 * (X[1] - X[0]);
		b1 = 2 * (Y[1] - Y[0]);
		c1 = X[0] * X[0] - X[1] * X[1] + Y[0] * Y[0] - Y[1] * Y[1];
		
		a2 = 2 * (X[2] - X[0]);
		b2 = 2 * (Y[2] - Y[0]);
		c2 = X[0] * X[0] - X[2] * X[2] + Y[0] * Y[0] - Y[2] * Y[2];
		
		ans[0] = (b1 * c2 - b2 * c1) / (a1 * b2 - a2 * b1);
		ans[1] = (c1 * a2 - c2 * a1) / (a1 * b2 - a2 * b1);
		ans[2] = sqrt( (ans[0] - X[0]) * (ans[0] - X[0]) + (ans[1] - Y[0]) * (ans[1] - Y[0]) );
		
		printf("%.3f %.3f %.3f\n", ans[0], ans[1], ans[2]);
	}
	
	return 0;
}