#include<bits/stdc++.h>
using namespace std;

void circumcenter(double x1, double y1, double x2, double y2, double x3,
                  double y3, double &cx, double &cy) {
  double a1, b1, c1, a2, b2, c2;
  a1 = x2 - x1;
  b1 = y2 - y1;
  c1 = x2 * x2 - x1 * x1 + y2 * y2 - y1 * y1;
  a2 = x3 - x2;
  b2 = y3 - y2;
  c2 = x3 * x3 - x2 * x2 + y3 * y3 - y2 * y2;
  cx = (b2 * c1 - b1 * c2) / (2.0 * (a1 * b2 - a2 * b1));
  cy = (a1 * c2 - a2 * c1) / (2.0 * (a1 * b2 - a2 * b1));
}

int main(){
    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 px, py, r;
        circumcenter(x1,y1,x2,y2,x3,y3,px,py);
        r = sqrt((px-x1)*(px-x1) + (py-y1)*(py-y1));
        printf("%.3f %.3f %.3f\n",px,py,r);
    }

    return 0;
}
