#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

int main() {
	int n;
	
	cin >> n;
	
	while (n>0) {
		double x1, y1, x2, y2, x3, y3;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		double xp = ((y1 - y3) * (y1 * y1 - y2 * y2 + x1 * x1 - x2 * x2) - (y1 - y2) * (y1 * y1 - y3 * y3 + x1 * x1 - x3 * x3)) / (2 * (y1 - y3) * (x1 - x2) - 2 * (y1 - y2) * (x1 - x3));
        double yp = ((x1 - x3) * (x1 * x1 - x2 * x2 + y1 * y1 - y2 * y2) - (x1 - x2) * (x1 * x1 - x3 * x3 + y1 * y1 - y3 * y3)) / (2 * (x1 - x3) * (y1 - y2) - 2 * (x1 - x2) * (y1 - y3));
		double r = sqrt((xp-x1)*(xp-x1)+(yp-y1)*(yp-y1));
		
		printf("%.3f %.3f %.3f\n", xp, yp, r);
		
		n--;
	}
	
	return 0;
}