#include<iostream>
#include<stdio.h>
#include<math.h>

using namespace std;

#define MAX 256

float LOSER(float x){
	if((int)(x*10000)%10 > 4)return x + 0.001;
	return x;
}

int main(void){
	int n,i = 0;
	float x1,y1,x2,y2,x3,y3;
	float px[MAX],py[MAX],r[MAX];
	
	cin >> n;
	while(i < n){
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		px[i] = ((y1-y3)*(y1*y1-y2*y2+x1*x1-x2*x2)+(y1-y2)*(y1*y1-y3*y3+x1*x1-x3*x3))/(2*(y1-y3)*(x1-x2)+2*(y1-y2)*(x1-x3));
		py[i] = ((x1-x3)*(x1*x1-x2*x2+y1*y1-y2*y2)+(x1-x2)*(x1*x1-x3*x3+y1*y1-y3*y3))/(2*(x1-x3)*(y1-y2)+2*(x1-x2)*(y1-y3));
		r[i] = sqrt((px[i]-x1)*(px[i]-x1)+(py[i]-y1)*(py[i]-y1));
		LOSER(px[i]);
		LOSER(py[i]);
		LOSER(r[i]);
		i++;
	}
	
	for(int i = 0;i < n;i++){
		scanf("%.3f %.3f %.3f",px[i],py[i],r[i]);
	}

	return 0;
}