#include<iostream>
#include<stdio.h>
#include<math.h>
#include<string>
#include<algorithm>
#include<utility>
using namespace std;
double zeti(double);
int main() {
	pair<double, double> a;
	pair<double, double> b;
	pair<double, double> c;
	pair<double, double> m1;
	pair<double, double> m2;
	double s1, s2,x1,y1,x2,y2,x,y,b1,b2;
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; ++i) {
		x = -1000.0;
		y = -1000.0;
		b1 = 0.0;
		b2 = 0.0;
		s1 = -1000.0;
		s2 = -1000.0;
		scanf("%lf%lf", &a.first, &a.second);
		scanf("%lf%lf", &b.first, &b.second);
		scanf("%lf%lf", &c.first, &c.second);
		m1.first = (a.first + b.first) / 2.0;
		m1.second = (a.second + b.second) / 2.0;
		m2.first = (b.first + c.first) / 2.0;
		m2.second = (b.second + c.second) / 2.0;
		swap(m1.first, m1.second);
		swap(m2.first, m2.second);
		//x is qual
		if (a.first - b.first == 0) {
			x = m1.first;
			b1 = m1.first;
		}
		//y is qual
		else if (a.second - b.second == 0) {
			y = m1.second;

		}
		else {
			s1 = (zeti(a.second - b.second)) / (zeti(a.first - b.first));
			b1 = s1*m1.first - m1.second;
		}
		//x is qual
		if (b.first - c.first == 0) {
			x = m2.first;
			b2 = m1.first;
		}
		//y is qual
		else if (b.second - c.second == 0) {
			y = m2.second;
		}
		else {
			s2 = (zeti(c.second - b.second)) / (zeti(c.first - b.first));
			b2 = s2*m2.first - m2.second;
		}
			s1 = 1.0 / s1*-1.0;
			s2 = 1.0 / s2*-1.0;

		if (x == -1000.0) {
			x = (b1 - b2) / (s2 - s1);
		}
		if (y==-1000.0&&s1 ==0.001) {
			y = s2*x + b2;
		}
		else if(y == -1000.0&&s2 == 0.001) {
			y = s1*x + b1;
		}
		double r,w,e;
		w = zeti(a.first - x);
		e = zeti(a.second - y);
		r = sqrt(w*w+e*e);
		printf("%.3lf %.3lf %.3lf\n", x, y,r);

	}
	return 0;
}
double zeti(double center) {
	if (center < 0) {
		center *= -1;
	}
	return center;
}
