#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>

using namespace std;

double sq(double x) {return x*x;}

void solve()
{
	double x1,y1,x2,y2,x3,y3;
	cin>>x1>>y1>>x2>>y2>>x3>>y3;
	double a,b,c,d,e,f;
	a = x2-x1; b = y2- y1;
	a*=2; b*= 2;
	c = sq(x2)-sq(x1)+sq(y2)-sq(y1);
	d = x3-x1; e = y3- y1;
	d *=2; e *= 2;
	f = sq(x3)-sq(x1)+sq(y3)-sq(y1);
    double det = a*e - b * d;
    double x = 1 / det * (c * e - b * f);
    double y = 1 / det * (f * a - c * d);
    if(x < 1e-5 && -1e-5 < x) x = 0.0;
    if(y < 1e-5 && -1e-5 < y) y = 0.0;
	double r = sqrt(sq(x - x1) + sq(y - y1));

	printf("%.3lf %.3lf %.3lf\n",x,y,r);
}

int main(){

	int t;
	cin >> t;
    while(t--){
		solve();
	}

	return 0;
}