#include<bits/stdc++.h>

using namespace std;
 
int aaa(){
    float x1,x2,x3,y1,y2,y3;
    std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    float a = sqrt((x1-x2) * (x1-x2) + (y1-y2) * (y1-y2));
    float b = sqrt((x1-x3) * (x1-x3) + (y1-y3) * (y1-y3));
    float c = sqrt((x2-x3) * (x2-x3) + (y2-y3) * (y2-y3));
    float q = (a+b+c) / 2; 
    float p = sqrt( (q-a) * (q-b) * (q-c) * q);
    float s = (2 * p) / (b * c);
    float r = a / (s * 2);
    a = a*a;
    b = b*b;
    c = c*c;
    float x = ( (b+c-a) * a*x3 + (a+c-b) * b*x2 + (a+b-c) * c*x1 ) / (p*p*16);
    float y = ( (b+c-a) * a*y3 + (a+c-b) * b*y2 + (a+b-c) * c*y1 ) / (p*p*16);
    printf("%.3lf %.3lf %.3lf\n", x, y, r);
    
    return 0;
}
 
int main(){
    int num;
    cin >> num;
    for(int i = 0;i < num; i++){
        aaa();
    }
    return 0;
}