#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
  double x1, y1, x2, y2, x3, y3;
  double px, py;
  double r;
  double M1, mx1, my1;
  double M2, mx2, my2;
  int n;
  cin >> n;

  while(1){
    if(n == 0) break;

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

    mx1 = (x1 + x2) / 2;
    my1 = (y1 + y2) / 2;
    if(y1 - y2 == 0) M1 = 0;
    else  M1 = (-1)*(x1 - x2) / (y1 - y2);
   

    mx2 = (x2 + x3) / 2;
    my2 = (y2 + y3) / 2;
    if(y2 - y3 == 0) M2 = 0;
    else  M2 = (-1)*(x2 - x3) / (y2 -y3);
    

    if(M1 == M2){
      px = mx1;
      py = my2;
    }
    else if(M1 != M2){
      px = (M1*mx1 - my1 - M2*mx2 + my2) / (M1 - M2);
      py = M1*(px - mx1) + my1;
    }

    r = sqrt((x1 - px)*(x1 - px) + (y1 - py)*(y1 - py));

    printf("%.3f %.3f %.3f\n",px,py,r);
    n--;
  }
 return 0; 
}