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

using namespace std;
int main() {
int s;
double a,b,c,d,e,f,g,h,i,j,m,n,x,y,r;
cin >> s;
for (s;s>0;s--) {
cin >> a >> b >> c >> d >> e >> f ;
if (b-d == 0) b=d+0.0000001;
if (f-d == 0) f=d+0.0000001;
m=(a-c)/(b-d); n=(e-c)/(f-d);
g=(a+c)/2; h=(b+d)/2;
i=(e+c)/2; j=(d+f)/2;
x=(j+n*i-h-m*g)/(n-m);
y=h-m*(x-g);
r=sqrt((x-a)*(x-a)+(y-b)*(y-b));
printf("%.3f %.3f %.3f\n",x,y,r);
}
return 0;
}