#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp make_pair
#define ERASE(v,i) (v).erase(remove(all(v),i),(v).end())
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define debug(x) cerr<<#x<<" = "<<(x)<<endl;
#define LINE cerr<<"LINE: "<<__LINE__<<endl;
inline int toInt(string s){int v;istringstream i(s);i>>v;return v;}
template<class T> inline string toString(T x){ostringstream o;o<<x;return o.str();}
template<class T> void pv(T a,T b){for(T it=a;it!=b;++it)cerr<<*it<<" ";cerr<<endl;}
const int INF = 1000000000;
const double PI = acos(-1.0), EPS = 1e-10;

inline double SQ(double x) {
	return x * x;
}

inline double DIST(double x1, double y1, double x2, double y2) {
	return sqrt(SQ(x1 - x2) + SQ(y1 - y2));
}

int main() {
	int N; cin >> N;
	while(N--) {
		double x1, y1, x2, y2, x3, y3;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

		double A = x1 - x2;
		double B = y1 - y2;
		double C = x1 - x3;
		double D = y1 - y3;
		
		double S = SQ(x1) - SQ(x2) + SQ(y1) - SQ(y2);
		double T = SQ(x1) - SQ(x3) + SQ(y1) - SQ(y3);
		
		double delta = (A * D - B * C);
		
		double X = (D * S - B * T) / 2 / delta;
		double Y = (-1 * C * S + A * T) / 2 / delta;
		
		printf("%.3f %.3f %.3f\n", X, Y, DIST(x1, y1, X, Y));
	}
	return 0;
}