//AOJのサイトの方で以前提出したコードを見れるみたい。保存していないものがあったので助かった。
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
float shisya(float a){
a*=1000;
a+=0.5;
a=(int)a;
a/=1000;
return a;
}
int main(){
float n, x1, y1, x2, y2, x3, y3;
float a, b, c, d, e, f;
float x, y, r;
cin>>n;
while(n--){
cin>>x1>>y1>>x2>>y2>>x3>>y3;
a = 2*(x2-x1);
b = 2*(y2-y1);
c = (x2*x2-x1*x1)+(y2*y2-y1*y1);
d = 2*(x3-x1);
e = 2*(y3-y1);
f = (x3*x3-x1*x1)+(y3*y3-y1*y1);
if((c*e-f*b)==0)
x=0;
else
x=(c*e-f*b)/(a*e-d*b);
if((c*d-a*f)==0)
y=0;
else
y=(c*d-a*f)/(b*d-a*e);
r = sqrt((x-x1)*(x-x1)+(y-y1)*(y-y1));
shisya(x);
shisya(y);
shisya(r);
cout<<setprecision(3)<<setiosflags(ios::fixed);
cout<<x<<' '<<y<<' '<<r<<"n";
}
return 0;
}