#include <bits/stdc++.h>
using namespace std;

double eps = 1e-10;

class Point {
public:
	double x, y;
	
	Point(double x = 0, double y = 0) : x(x), y(y) {}
	
	Point operator + (const Point& p) {
		return Point(x + p.x, y + p.y);
	}
	Point operator - (const Point& p) {
		return Point(x - p.x, y - p.y);
	}
	Point operator * (const double& a) {
		return Point(x * a, y * a);
	}
	Point operator / (const double& a) {
		return Point(x / a, y / a);
	}
	
	bool operator < (const Point& p) const {
		return x != p.x ? x < p.x : y < p.y;
	}
	bool operator == (const Point &p) const {
		return fabs(x - p.x) < eps && fabs(y - p.y) < eps;
	}
	
	double abs() {
		return sqrt(norm());
	}
	double norm() {
		return x * x + y * y;
	}
	
};

typedef Point Vector;

bool equals(const double& a, const double& b) {
	return fabs(a - b) < eps;
}

double dot(const Vector& a, const Vector& b){
	return a.x * b.x + a.y * b.y;	
}

double cross(const Vector& a, const Vector& b){
	return a.x * b.y - a.y * b.x;
}

class Triangle {
public:
	Point p1, p2, p3; // ??????
	Vector v1, v2, v3; // ??????????????????
	double e1, e2, e3; // ????????§??????
	double a1, a2, a3; // ?§????(????????¢???)
	
	Triangle(Point a, Point b, Point c) : p1(a), p2(b), p3(c) {
		v1 = p3 - p2; v2 = p3 - p1; v3 = p2 - p1;
		e1 = v1.abs(); e2 = v2.abs(); e3 = v3.abs();
		a1 = law_of_cosines(e1, e2, e3); a2 = law_of_cosines(e2, e1, e3);
		a3 = law_of_cosines(e3, e2, e1);
	}
	
	// ????????????(?????????:?§????)
	double law_of_cosines(const double& a, const double& b, const double& c) { 
		return acos((b * b + c * c - a * a) / (2.0 * b * c));
	}
	
	double calc_radius_circumcenter() {
		return e1 / (2.0 * sin(a1));
	}
	// ?????????????????????
	Vector calc_vec_circumcenter() {
		return (v1 * sin(2.0 * a1) + v2 * sin(2.0 * a2) + v3 * sin(2.0 * a3))
		       / (sin(2.0 * a1) + sin(2.0 * a2) + sin(2.0 * a3));
	}
	
	// ???????????§?¨?
	Point calc_p_circumcenter() {
		return Point((p1.x * sin(2.0 * a1) + p2.x * sin(2.0 * a2) + p3.x * sin(2.0 * a3))
		             / (sin(2.0 * a1) + sin(2.0 * a2) + sin(2.0 * a3)),
		             (p1.y * sin(2.0 * a1) + p2.y * sin(2.0 * a2) + p3.y * sin(2.0 * a3))
		             / (sin(2.0 * a1) + sin(2.0 * a2) + sin(2.0 * a3)));
	}
};

int main() {
	int n;
	cin >> n;
	double x1, x2, x3, y1, y2, y3;
	for(int i = 0; i < n; ++i){
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		Triangle t = Triangle(Point(x1, y1), Point(x2, y2), Point(x3, y3));
		Point p = t.calc_p_circumcenter();
		printf("%.3f %.3f %.3f\n", p.x, p.y, t.calc_radius_circumcenter());
	}
	return 0;
}