#include<cstdio>
#include<cstring>
#include<iostream>
#include<cstdlib>
#include<cmath>
using namespace std;
#define PI M_PI
double GetLen(double x1,double y1,double x2,double y2){
  return sqrt((y2-y1)*(y2-y1)+(x2-x1)*(x2-x1));
}
double GetAn(double x1,double y1,double x2,double y2){
  return atan((y2-y1)/(x2-x1));
}
double GetRadToAn(double rd){
  return rd*(180/PI);
}
double GetAnToX(double an,double len){
  return cos(an)*len;
}
double GetAnToY(double an,double len){
  return sin(an)*len;
}
main(){
  int n;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    double x1,y1,x2,y2,x3,y3; 
    scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
    double R;
    double a,b,c;
    a=GetLen(x1,y1,x2,y2);
    b=GetLen(x2,y2,x3,y3);
    c=GetLen(x3,y3,x1,y1);
    R=(a*b*c)/sqrt((a+b+c)*(-a+b+c)*(a-b+c)*(a+b-c));
    double an1=GetAn(x1,y1,x2,y2);
    double x4,y4;
    double h=a/2.0;
    x4=GetAnToX(an1,h)+x1;
    y4=GetAnToY(an1,h)+y1;
    double z=sqrt(R*R-h*h);
    double an2=an1-PI/2.0;
    double an3=an1+PI/2.0;

    double rx,ry;
    rx=GetAnToX(an3,z)+x4;
    ry=GetAnToY(an3,z)+y4;
    if(GetLen(rx,ry,x3,y3)==R) printf("%.3f %.3f %.3f\n",rx,ry,R);
    else{
      rx=GetAnToX(an2,z)+x4;
      ry=GetAnToY(an2,z)+y4;
      printf("%.3f %.3f %.3f\n",rx,ry,R);
    }
  }
}