#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

static const double EPS = 1e-9;
typedef long long ll;
typedef pair<int, int> paii;
typedef complex<double> P;

double ccw(P& p1, P& p2, P& p3)
{
	return ((p2.real() - p1.real())*(p3.imag() - p1.imag()) 
				- (p2.imag() - p1.imag())*(p3.real() - p1.real())) > 0;
}// ccw>0 ...ccw, ccw=0 ...colinear, ccw<0 ...cw

int main()
{
	int n;
	cin >> n;
	
	while(n--)
	{
		double x1, x2, x3, y1, y2, y3;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		
		double a1 = 2*(x2-x1);
		double b1 = 2*(y2-y1);
		double c1 = x1*x1-x2*x2+y1*y1-y2*y2;
		double a2 = 2*(x3-x1);
		double b2 = 2*(y3-y1);
		double c2 = x1*x1-x3*x3+y1*y1-y3*y3;
		
		double xp = (b1*c2-b2*c1)/(a1*b2-a2*b1);
		double yp = (c1*a2-c2*a1)/(a1*b2-a2*b1);
		double r = hypot((xp-x1), (yp-y1));
		
		cout.precision(3);
		printf("%.3f %.3f %.3f\n", xp,yp, r);
	}
	
	return 0;
}