#include<cstdio>
#include<cmath>

using namespace std;

double X1,Y1,X2,Y2,X3,Y3,a,b,c,d,e,f,px,py,r;

int main(){
    int n; scanf( "%d", &n );
    for( int i = 0; i < n; i++ )
    {
        scanf( "%lf %lf %lf %lf %lf %lf", &X1, &Y1, &X2, &Y2, &X3, &Y3 );
        a = ( X2 - X1 ), b = ( Y2 - Y1 ), e = ( a * ( X1 + X2 ) / 2 + b * ( Y1 + Y2 ) / 2 );
        c = ( X3 - X2 ), d = ( Y3 - Y2 ), f = ( c * ( X2 + X3 ) / 2 + d * ( Y2 + Y3 ) / 2 );
        px = ( e * d - b * f ) / ( a * d - b * c ), py = ( a * f - e * c ) / ( a * d - b * c );
        r = ( px - X1 ) * ( px - X1 ) + ( py - Y1 ) * ( py - Y1 );
        r = sqrt( r );
        printf( "%lf %lf %lf\n", px, py, r );
        n--;
    }
    return 0;
}
