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

//0010
int main(){
	int n;
	while(cin >> n){
		double x1,y1,x2,y2,x3,y3,x,y,r;

		while(n--){
			cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

			if(x1!=x2){
				x=(x1+x2)/2;
			}else if(x2!=x3){
				x=(x2+x3)/2;
			}else if(x3!=x1){
				x=(x3+x1)/2;
			}
			if(y1!=y2){
				y=(y1+y2)/2;
			}else if(y2!=y3){
				y=(y2+y3)/2;
			}else if(y3!=y1){
				y=(y3+y1)/2;
			}

			r=sqrt(pow(x-x1,2)+pow(y-y1,2));
			x+=0.0005;
			y+=0.0005;
			r+=0.0005;
			cout.setf(ios::fixed);
			cout.precision(3);
			cout << x << " " << y << " " << r << endl;
		}
	}

}