//
//  main.cpp
//  CppTest
//
//  Created by Ryu on 2017/02/08.
//  Copyright ?? 2017??´ Ryu. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n = 0;
    cin >> n;
    
    float cx[n], cy[n], R[n];
    
    float x[3];
    float y[3];
    float alp[6];
    float d;
    for (int i = 0; i < n; i++) {
        cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
        alp[0] = x[1] - x[0];
        alp[1] = y[1] - y[0];
        alp[2] = alp[0] * (x[0] + x[1]) / 2 + alp[1] * (y[0] + y[1]) / 2;
        alp[3] = x[2] - x[0];
        alp[4] = y[2] - y[0];
        alp[5] = alp[3] * (x[0] + x[2]) / 2 + alp[4] * (y[0] + y[2]) / 2;
        for (int j = 0; j < 6; j++) {
            //printf("%d = %f, ", j, alp[j]);
        }
        d = alp[0] * alp[4] - alp[1] * alp[3];
        //printf("d = %f\n", d);
        cx[i] = (alp[4] * alp[2] - alp[1] * alp[5]) / d;
        cy[i] = (0 - alp[3] * alp[2] + alp[0] * alp[5]) / d;
        R[i] = pow(pow(x[0] - cx[i], 2) + pow(y[0] - cy[i], 2), 0.5);
        if(cx[i] == -0){
            cx[i] = 0;
        }
        if (cy[i] == -0) {
            cy[i] = 0;
        }
        printf("%.3f %.3f %.3f", cx[i], cy[i], R[i]);
    }
    
    
    
    return 0;
}