#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;

int main() {
	int n;
	double x1, y1, x2, y2, x3, y3;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		double x12, y12, x13, y13;
		x12 = (x1 + x2) / 2.0;
		y12 = (y1 + y2) / 2.0;
		x13 = (x1 + x3) / 2.0;
		y13 = (y1 + y3) / 2.0;
		double vx12, vy12, vx13, vy13;
		vx12 = x2-x1;
		vy12 = y2-y1;
		vx13 = x3-x1;
		vy13 = y3-y1;
		double x, y;
		x = (vx12*vy13*x12-vx13*vy12*x13+vy12*vy13*(y13-y12))/(vx12*vy13-vx13*vy12);
		y = y13 - vx13*(x-x13)/vy13;
		double r;
		r = sqrt((x-x1)*(x-x1)+(y-y1)*(y-y1));
		printf("%.3f %.3f %.3f\n", x, y, r);
	}
	return 0;
}