#include <stdio.h>
#include <math.h>
#define sqr(x) ((x) * (x))

int main() {
	double x1, y1, x2, y2, x3, y3;
	double xp, yp, r;
	int n;
	int i;

	scanf("%d", &n);

	for(i = 0; i < n; i++) {
		scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);

		xp = ((sqr(x1) - sqr(x2) + sqr(y1) - sqr(y2)) * (y2 - y3) - (sqr(x2) - sqr(x3) + sqr(y2) - sqr(y3)) * (y1 - y2))
				/ (2 * ((x1 - x2) * (y2 - y3) - (x2 - x3) * (y1 - y2)));

		yp = ((sqr(x1) - sqr(x2) + sqr(y1) - sqr(y2)) * (x2 - x3) - (sqr(x2) - sqr(x3) + sqr(y2) - sqr(y3)) * (x1 - x2))
				/ (2 * ((y1 - y2) * (x2 - x3) - (y2 - y3) * (x1 - x2)));

		r = sqrt(sqr(x1 - xp) + sqr(y1 - yp));
	
		printf("%.3lf %.3lf %.3lf\n", xp, yp, r);

	}

	return 0;
}