#include <iostream>
#include <cstdio>
#include <cmath>
#include <utility>
using namespace std;


class vec{
public:
	double x;
	double y;
	double normEXP2() const{
		return x*x + y*y;
	}
	vec& operator+(const vec& v){
		x += v.x;
		y += v.y;
		return *this;
	}
	vec& operator-(const vec& v){
		x -= v.x;
		y -= v.y;
		return *this;
	}
	vec& operator*(double scala){
		x *= scala;
		y *= scala;
		return *this;
	}
	double operator*(const vec& v) const{
		return x*v.x + y*v.y;
	}
};


istream& operator>>(istream& i, vec& v){
	i >> v.x >> v.y;
	return i;
}


pair<double, double> cramer(const vec& a, const vec& b){
	pair<double, double> solve;
	solve.first = (2 * a.normEXP2()*b.normEXP2() - 2 * b.normEXP2()*(a*b)) / (4 * a.normEXP2()*b.normEXP2() - 4 * ((a*b)*(a*b)));
	solve.second = (2 * a.normEXP2()*b.normEXP2() - 2 * a.normEXP2()*(a*b)) / (4 * a.normEXP2()*b.normEXP2() - 4 * ((a*b)*(a*b)));

	return solve;
}


int main(){
	int n;
	vec v1, v2, v3;
	vec b, c;
	vec solveVec;
	pair<double, double> solve;
	double x, y;
	double r;

	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> v1 >> v2 >> v3;
		b = v2 - v1;
		c = v3 - v1;
		
		solve = cramer(b, c);
		solveVec = (b*solve.first) + (c*solve.second);

		solveVec = v1 + solveVec;
		r = sqrt(solveVec.normEXP2());

		y = (double)((int)((solveVec.y * 1000) + 0.5)) / 1000;
		r = (double)((int)((r * 1000) + 0.5)) / 1000;
		x = (double)((int)((solveVec.x * 1000) + 0.5)) / 1000;

		printf("%.3lf %.3lf %.3lf\n", x, y, r);
	}

	return 0;
}