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

int main()
{
  int setcount;
  float x1, y1, x2, y2, x3, y3;
  float nx1, ny1, nx2, ny2;
  float nr1, nr2;
  float xp, yp, r;
  int tx, ty, tr, rem;
  int i;

  scanf("%d", &setcount);
  for(i=0; i<setcount; i++){
    scanf("%f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3);
    nx1=x2-x1; ny1=y2-y1;
    nx2=x3-x1; ny2=y3-y1;
    nr1=nx1^2+ny1^2; nr2=nx2^2+ny2^2;
    nr1*=0.5f; nr2*=0.5f;

    if(nx1==0){
      nr1/=ny1; ny1=1.0f;
      nr2-=nr1*ny2; ny2=0.0f;
      nr2/=nx2; nx2=1.0f;
    }
    else {
      //normalize
      ny1/=nx1; nr1/=nx1; nx1=1.0f;
      //subtraction
      ny2-=ny1*nx2; nr2-=nr1*nx2; nx2=0.0f;
      //normalize
      nr2/=ny2; ny2=1.0f;
      //subtraction
      nr1-=nr2*ny1; ny1=0.0f;
    }


    printf("%.3f %.3f %.3f\n", xp, yp, r);
  }

  return 0;
}