#include<iostream>
#include<stdio.h>
#include<cmath>
#include<iomanip>
using namespace std;

int main(){
  double x1,x2,x3,y1,y2,y3,x,n;

  cin >> n;
  int i=0;
  while(i < n){
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    double sina,R,BC = sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3)),p,q;
    sina = ((x2-x1)*(x3-x1) + (y2-y1)*(y3-y1)) / sqrt(((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))*((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1)));

    p = ((y1-y3)*(y1*y1 - y2*y2 + x1*x1 - x2*x2) - (y1-y2)*(y1*y1-y3*y3+x1*x1 -x3*x3))/(2*(y1-y3)*(x1-x2)-2*(y1-y2)*(x1-x3));
    q = ((x1-x3)*(x1*x1 - x2*x2 + y1*y1 - y2*y2) - (x1-x2)*(x1*x1-x3*x3+y1*y1 -y3*y3))/(2*(x1-x3)*(y1-y2)-2*(x1-x2)*(y1-y3));
    R = BC/(2*sina);
    printf("%.3lf %.3lf %.3lf\n",p,q,R);
    i++;
  }
}