#include <iostream>
#include <vector>
//#include <math.h>
//#include <string>
#include <cmath>
#include <iomanip>

int main();
double round(double dSrc, int iLen);

int main(){
	int cnt = 0;		//データセットの個数
	double x1, y1, x2, y2, x3, y3;
	std::vector<double> p;		//外接円の中心のx座標
	std::vector<double> q;		//外接円の中心のy座標
	std::vector<double> r;		//外接円の半径
	
	std::cin >> cnt;
	for (int i = 0; i < cnt; i++){
		std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		p.push_back(((y1 - y3) * (pow(y1, 2) - pow(y2, 2) + pow(x1, 2) - pow(x2, 2)) - (y1 - y2) * (pow(y1, 2) - pow(y3, 2) + pow(x1, 2) - pow(x3, 2))) / (2 * (y1 - y3) * (x1 - x2) - 2 * (y1 - y2) * (x1 - x3)));
		q.push_back(((x1 - x3) * (pow(x1, 2) - pow(x2, 2) + pow(y1, 2) - pow(y2, 2)) - (x1 - x2) * (pow(x1, 2) - pow(x3, 2) + pow(y1, 2) - pow(y3, 2))) / (2 * (x1 - x3) * (y1 - y2) - 2 * (x1 - x2) * (y1 - y3)));
		r.push_back(sqrt((pow((p[i] - x1), 2) + pow((q[i] - y1), 2))));

		int temp = p[i];
		if (p[i] - temp != 0){
			p[i] = round(p[i], 3);
		}

		temp = q[i];
		if (q[i] - temp != 0){
			q[i] = round(q[i], 3);
		}
		
		temp = r[i];
		if (r[i] - temp != 0){
			r[i] = round(r[i], 3);
		}

		std::cout << std::fixed << std::setprecision(3) << p[i] << " " << q[i] << " " << r[i] << std::endl;
	}
	/*
	for (int i = 0; i < cnt; i++){
		int temp = p[i];
		if (p[i] - temp != 0){
			p[i] = round(p[i], 3);
		}

		temp = q[i];
		if (q[i] - temp != 0){
			q[i] = round(q[i], 3);
		}
		
		temp = r[i];
		if (r[i] - temp != 0){
			r[i] = round(r[i], 3);
		}

		std::cout << std::fixed << std::setprecision(3) << p[i] << " " << q[i] << " " << r[i] << std::endl;
	}
	*/

	//while (1);
	return 0;
}

/**
* 指定桁で四捨五入を行う
* args:数値, 四捨五入する桁数
* return:結果
* 参考:http://oresi.hatenablog.com/entry/2014/06/23/【C%2CC%2B%2B】指定桁数で端数処理%EF%BC%88切り上げ、切り下げ
*/
double round(double dSrc, int iLen)
{
	double	dRet;

	dRet = dSrc * pow(10.0, iLen);
	dRet = (double)(int)(dRet + 0.5);

	return dRet * pow(10.0, -iLen);
}
