#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>

using namespace std;

int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
	{
		double x[3], y[3];
		for (int j = 0; j < 3; ++j)
			scanf("%lf %lf", x+j, y+j);
		
		double a[2], b[2];
		for (int j = 0; j < 2; ++j)
		{
			a[j] = -(x[2]-x[j])/(y[2]-y[j]);
			b[j] = (y[2]+y[j] - (x[2]+x[j])*a[j])/2;
		}
		double px = (b[0]-b[1])/(a[1]-a[0]);
		double py = a[0] * px + b[0];
		double r = sqrt((px-x[0])*(px-x[0])+(py-y[0])*(py-y[0]));
		printf("%f %f %f\n", px, py, r);
	}

	return 0;
}