#include<iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl

double a[6];

void solve(){
	double x,y;
	double c[2];
	c[0]=(a[0]+a[2])/2.0;
	c[1]=(a[1]+a[3])/2.0;
	
	double l1[2], k1[2];
	k1[0]=-(a[3]-a[1]);
	k1[1]=(a[2]-a[0]);
	
	double d[2];
	d[0]=(a[4]+a[2])/2.0;
	d[1]=(a[5]+a[3])/2.0;
	
	double l2[2], k2[2];
	k2[0]=-(a[3]-a[5]);
	k2[1]=(a[2]-a[4]);
	
	if(k1[0]==0){
		x=c[0];
		l2[0]=k2[1]/k2[0];
		l2[1]=-l2[0]*d[0]+d[1];
		y=l2[0]*x+l2[1];
		
	}
	else if(k2[0]==0){
		x=d[0];
		l1[0]=k1[1]/k1[0];
		l1[1]=-l1[0]*c[0]+c[1];
		y=l1[0]*x+l1[1];
	}
	else{
		l1[0]=k1[1]/k1[0];
		l1[1]=-l1[0]*c[0]+c[1];
		
		l2[0]=k2[1]/k2[0];
		l2[1]=-l2[0]*d[0]+d[1];
		
		x=-(l2[1]-l1[1])/(l2[0]-l1[0]);
		y=l1[0]*x+l1[1];
	}
	double r=sqrt((x-a[0])*(x-a[0])+(y-a[1])*(y-a[1]));
	
	printf("%.3f %.3f %.3f\n",x,y,r);
}

int main(){
	li n;
	cin>>n;
	
	rin{
		rep(j,6)cin>>a[j];
		solve();
	}
	
	return 0;
}