#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
using namespace std;

int main(){
    int n;
    cin >> n;
    REP(i, n){
        double x1, x2, x3, y1, y2, y3, div;
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        div = x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2);
        double r1, r2, r3, X, Y, R;
        r1 = x1*x1 + y1*y1;
        r2 = x2*x2 + y2*y2;
        r3 = x3*x3 + y3*y3;
        X = r1*(y2-y3) + r2*(y3-y1) + r3*(y1-y2);
        Y = r1*(x3-x2) + r2*(x1-x3) + r3*(x2-x1);
        X = X / div / 2;
        Y = Y / div / 2;
        R = sqrt((X-x1)*(X-x1)+(Y-y1)*(Y-y1));
        printf("%.3f %.3f %.3f\n", X, Y, R);
    }
}
