#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>

using namespace std;

int sosuu(int n);

int main(){
    double x[3]={0};
    double y[3]={0};
    int i=0;
    scanf("%d",&i);
    while(scanf("%lf",&x[0])!=EOF){
        scanf("%lf",&y[0]);
        scanf("%lf",&x[1]);
        scanf("%lf",&y[1]);
        scanf("%lf",&x[2]);
        scanf("%lf",&y[2]);
        
        double a1= 2*(x[1]-x[0]);
        double b1= 2*(y[1]-y[0]);
        double c1= x[0]*x[0]-x[1]*x[1]+y[0]*y[0]-y[1]*y[1];
        
        double a2= 2*(x[2]-x[0]);
        double b2= 2*(y[2]-y[0]);
        double c2= x[0]*x[0]-x[2]*x[2]+y[0]*y[0]-y[2]*y[2];
        
        double xa = (b1*c2-b2*c1)/(a1*b2-a2*b1);
        double ya = (c1*a2-c2*a1)/(a1*b2-a2*b1);
        
        double r =sqrt((xa-x[0])*(xa-x[0])+(ya-y[0])*(ya-y[0]));
        
        printf("%.3lf %.3lf %.3lf\n",xa,ya,r);
        
    }
    
}