#include<bits/stdc++.h>
using namespace std;

struct Point{double x, y;};

Point center2(Point p1, Point p2, Point p3){
	Point p;
	if(p1.y == p2.y){
		p.x = (p1.x + p2.x) / 2.0;
	}else if(p2.y == p3.y){
		p.x = (p2.x + p3.x) / 2.0;
	}
	p.y = p.x - (p2.x + p3.x) / 2.0;
	p.y *= -(p3.x - p2.x) / (p3.y - p2.y);
	p.y += (p2.y + p3.y) / 2.0;
	return p;
}

Point center(Point p1, Point p2, Point p3){
	if(p1.y == p2.y || p2.y == p3.y) return center2(p1, p2, p3);
	Point p;
	p.x = 0.0;
	p.x += (p3.y - p1.y) / 2.0;
	p.x -= (p2.x * p2.x - p1.x * p1.x) / (2.0 * (p2.y - p1.y));
	p.x += (p3.x * p3.x - p2.x * p2.x) / (2.0 * (p3.y - p2.y));
	p.x /= ((p3.x - p2.x) / (p3.y - p2.y) - (p2.x - p1.x) / (p2.y - p1.y));
	p.y = p.x - (p2.x + p3.x) / 2.0;
	p.y *= -(p3.x - p2.x) / (p3.y - p2.y);
	p.y += (p2.y + p3.y) / 2.0;
	return p;
}

double rounding(double d){
	if(d - (int)floor(d) < 0.5) return floor(d);
	else return ceil(d);
}

int main(){
	int n;
	Point p1, p2, p3;
	Point p;
	double r;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%lf %lf %lf %lf %lf %lf", &p1.x, &p1.y, &p2.x, &p2.y, &p3.x, &p3.y);
		p = center(p1, p2, p3);
		r = sqrt((p.x - p1.x) * (p.x - p1.x) + (p.y - p1.y) * (p.y - p1.y));
		printf("%.3lf %.3lf %.3lf\n", rounding(p.x * 1000.0) / 1000.0, rounding(p.y * 1000.0) / 1000.0, rounding(r * 1000.0) / 1000.0);
	}
	return 0;
}