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

int main(){

  long double x1,x2,x3,y1,y2,y3;
  long double p,q,r;
  int tmp;
  int n;

  cin >> n;

  while(n--){
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

    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*x3)) / (2*(x1-x3)*(y1-y2)-2*(x1-x2)*(y1-y3));

    r2 = sqrt((x1-p)*(x1-p) + (y1-q)*(y1-q));

    printf("%.3Lf %.3Lf %.3Lf\n", p, q, r);
  }
}