#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-12;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;

#include <complex>
typedef complex<double> P;
typedef vector<P> vP;
typedef vector<double> vd;

#define EQ(x,y) (abs((x)-(y))<EPS)

double dot(P a, P b) {
	return (a.real()*b.real() + a.imag()*b.imag());
}

double cross(P a, P b) {
	return (a.real()*b.imag() - a.imag()*b.real());
}

double distance_ls_p(P a, P b, P c) {
	if(dot(b-a, c-a) < -EPS) return abs(c-a);
	if(dot(a-b, c-b) < -EPS) return abs(c-b);
	return abs(cross(b-a, c-a)) / abs(b-a);
}

P rotate(P t, P p, double r) {
	double ta = cos(r)*(t.real()-p.real())-sin(r)*(t.imag()-p.imag())+p.real();
	double tb = sin(r)*(t.real()-p.real())-cos(r)*(t.imag()-p.imag())+p.imag();
	return P(ta, tb);
}

double to_radian(double degree) {
	return degree*PI/180.0;
}

P intersection_l(P a1, P a2, P b1, P b2) {
	P a = a2 - a1;
	P b = b2 - b1;
	return a1 + a * cross(b, b1-a1) / cross(b, a);
}

double area(P a, P b, P c) {
	return abs(cross(c-a, b-a)*0.5);
}

int main() {
	int n;
	cin >> n;
	REP(_, n) {
		double x1, y1, x2, y2, x3, y3;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

		P A(x1, y1), B(x2, y2), C(x3, y3);
		P mAB((x1+x2)/2, (y1+y2)/2), mBC((x2+x3)/2, (y2+y3)/2);
		P nAB = rotate(B, mAB, to_radian(90));
		P nBC = rotate(C, mBC, to_radian(90));

		P p = intersection_l(mAB, nAB, mBC, nBC);
		double r = abs(A-p);

		printf("%.3f %.3f %.3f\n", p.real(), p.imag(), r);
	}

	return 0;
}