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

using db = double;

struct poi {
	db x, y;
	void r() { cin >> x >> y; }
	poi operator -(poi p) {
		return {x - p.x, y - p.y};
	}
	poi operator /(db d) {
		return {x / d, y / d};
	}
	db cross(poi p) {
		return x * p.y - y * p.x;
	}
	db len2() {
		return x * x + y * y;
	}
};

poi circum(poi a, poi b, poi c) {
	poi ba = b - a, ca = c - a;
	db lb = ba.len2(), lc = ca.len2(), s = ba.cross(ca);
	return a - poi{ba.y * lc - ca.y * lb,
		ca.x * lb - ba.x * lc} / s / 2;
}

int main() {
	cout << fixed << setprecision(3);
	ios :: sync_with_stdio(false);
	int t; cin >> t;
	while(t --) {
		poi a, b, c;
		a.r(); b.r(); c.r();
		poi o = circum(a, b, c);
		cout << o.x << ' ' << o.y << ' ' << sqrt((o - a).len2()) << '\n';
	}
	return 0;
}