#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair

const int INF = 1 << 24;
const int dx[4] = {0, 0, 1, -1}, dy[4] = {1, -1, 0, 0};

typedef unsigned long long ull;

struct P{
    double x, y;
    double size(){
        return std::sqrt(x*x + y*y);
    }
    double sizeS(){
        return x*x + y*y;
    }
    P toUnit(){
        return {x / size(), y / size()};
    }
    P rotate(int angle){
        if(angle == 0){ // 反時計
            return {-y, x};
        }
        return {y, -x};
    }
};

P operator+(const P& lp, const P& rp){
    return {lp.x+rp.x, lp.y+rp.y};
}

P operator-(const P& lp, const P& rp){
    return {lp.x-rp.x, lp.y-rp.y};
}

P operator*(const P& p, const double& k){
    return {k*p.x, k*p.y};
}

double cross(const P& lp, const P& rp){
    return lp.x * rp.y - lp.y * rp.x;
}

double roundOff(double v, int k){
    int i = std::abs(v * pow(10, k)) + 0.5;
    if(v >= 0){
        return 1.0 * i / pow(10, k);
    }
    return -1.0 * i / pow(10, k);
}

int main(){
    int N;
    std::cin >> N;

    REP(i, N){
        P A, B, C, v1, v2, v3;
        std::cin >> A.x >> A.y >> B.x >> B.y >> C.x >> C.y;
        v1 = B - A; v2 = C - A, v3 = B - C;

        double sinA = std::abs(cross(v1, v2)) / (v1.size() * v2.size()),
            r = v3.size() / 2.0 / sinA, k = std::sqrt(r*r-v1.sizeS()/4);

        P m = v1*0.5, p = A + m + m.rotate(cross(A, C) < 0).toUnit() * k;
    
        printf("%.6f\n", p.x * 1000 + 0.5);

        double x = roundOff(p.x, 3), y = roundOff(p.y, 3), R = roundOff(r, 3);
        printf("%.3f %.3f %.3f\n", x, y, R);
    }
}