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


int main(void){

  int n;
  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))/2;


    double x = A*(B+C-A) / s;
    double y = B*(C+A-B) / s;

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

  }




  return 0;
}