#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;


int main(void){

    int n;
  while(cin >> n){
    
    for(int i = 0;i < n;i++){

      double x1,y1,x2,y2,x3,y3;
      cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

      double a = sqrt(pow(x2-x1,2) + pow(y2-y1,2));
      double b = sqrt(pow(x3-x2,2) + pow(y3-y2,2));
      double c = sqrt(pow(x3-x1,2) + pow(y3-y1,2));

      double r = a*b*c / sqrt((a+b+c)*(-a+b+c)*(a-b+c)*(a+b-c));

      double A = pow(x2-x1,2) + pow(y2-y1,2);
      double B = pow(x3-x2,2) + pow(y3-y2,2);
      double C = pow(x3-x1,2) + pow(y3-y1,2);
      double s = (A*(B+C-A) + B*(C+A-B) + C*(A+B-C));


      double x = 2*A*(B+C-A) / s;
      double y = 2*B*(C+A-B) / s;
      if(x == 0){
        x = 0;
      }
      if(y == 0){
        y=0;
      }

      printf("%.3f %.3f %.3f\n",x,y,r);

    }
  }




  return 0;
}

