#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
using namespace std;
typedef vector <double> vd;
typedef vector <vd> vvd;

int equation(vvd &A){
    int n1=3;
	for (int i1=0; i1<n1; i1++){
		int j1=i1;
		if (A[j1][i1]==0)
			for (int j2=j1+1; j2<n1; j2++)
				if (A[j2][i1]!=0){
					for (int i3=0; i3<n1+1; i3++)
						swap(A[j2][i3], A[j1][i3]);
					break;
				}
		double tmp = A[j1][i1];
		for (int i2=0; i2<n1+1; i2++)
			A[j1][i2]/=tmp;

		for (int j2=0; j2<n1; j2++){
			if (j2==j1) continue;
			tmp = A[j2][i1];
			for (int i2=0; i2<n1+1; i2++)
				A[j2][i2] -= tmp * A[j1][i2];
		}
	}

    return 0;
}

int main(void){
    int n=0;
	double x=0, y=0, x0=0, y0=0, r=0;
	vvd A(3, vd(4));

	cin>>n;
	for (int i=0; i<n; i++){
		for (int j=0; j<3; j++){
			cin>>x>>y;
			A[j][0] = x;
			A[j][1] = y;
			A[j][2] = 1;
			A[j][3] = -(x*x + y*y);
		}
		equation(A);

		x0 = -A[0][3] / 2;
		y0 = -A[1][3] / 2;
		r = sqrt(pow(x-x0, 2) + pow(y-y0, 2));

		cout<<fixed<<setprecision(3);
		cout<<x0<<" "<<y0<<" "<<r<<endl;
	}
    return 0;
}