#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;

		if(y1-y2==0.0 || y1-y3==0.0){
			swap(x1, x2);
			swap(y1, y2);
		}
		if(y1-y2==0.0 || y1-y3==0.0){
			swap(x1, x3);
			swap(y1, y3);
		}

		double a12, b12, a13, b13;
		a12 = -(x1-x2)/(y1-y2);
		a13 = -(x1-x3)/(y1-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;

		b12 = y12 - a12 * x12;
		b13 = y13 - a13 * x13;

		double xp, yp;
		xp = -(b12-b13)/(a12-a13);
		yp = a12*xp + b12;

		double r;
		r = sqrt(pow((x1-xp),2.0) + pow((y1-yp),2.0));

		printf("%.3f %.3f %.3f\n", xp, yp, r);
	}


	return(0);
}