#include <iostream>
#include <math.h>

using namespace std;

int main(){
	int n;
	cin >> n;

	for(int i=0; i<n; i++){
		double x1, y1, x2, y2, x3, y3;
		double px, py, r;

		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

		px = (x1 + x2 + x3) / 3;
		py = (y1 + y2 + y3) / 3;
		r = sqrt((x1-px)*(x1-px) + (y1-py)*(y1-py));

		printf("%.3f %.3f %.3f\n", px, py, r);
	}
}