#include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

double add_double(double a,double b){
	if(abs(a+b)<eps*(abs(a)+abs(b))) return 0;
	return a+b;
}

struct point{
	double x,y;
	point operator+(point p){
		return point{add_double(x,p.x),add_double(y,p.y)};
	}
	point operator-(point p){
		return point{add_double(x,-p.x),add_double(y,-p.y)};
	}
	point operator*(double p){
		return point{x*p,y*p};
	}
	point operator/(double p){
		if(!p) return point{0,0}; 
		return point{x/p,y/p};
	}
	bool operator==(point p){
		return fabs(add_double(x,-p.x))<eps&&fabs(add_double(y,-p.y))<eps;
	}
	bool operator<(point p){
		if(fabs(x-p.x)>eps) return x<p.x;
		return y<p.y;
	}
};

typedef pair<point,point> pp;
typedef vector<point> VP;
const point O{0,0};

int n;
VP Tri(3);

class Geom{
	public:
	double Length(point x,point y){
		point z=y-x;
		return sqrt(z.x*z.x+z.y*z.y);
	}
	double IP(point p,point q){
		return p.x*q.x+p.y*q.y;
	}
	double CP(point p,point q){
		return p.x*q.y-q.x*p.y;
	}
	point Inter(pp  a,double x,double y){
		return (a.first*y+a.second*x)/(x+y);
	}
	point Exterior(pp a,double x,double y){
		return (a.first*-y+a.second*x)/(x-y);
	}
	point Normal(point p){
		return point{p.y,-p.x};
	}
	string Counter_Clockwise(pp a,point x){
		point A=a.second-a.first;
		point X=x-a.first;
		double ip=IP(A,X),cp=CP(A,X),Al=Length(O,A),Xl=Length(O,X);
		if(cp>eps) return "Counter_Clockwise";
		if(cp<-eps) return "Clockwise";
		if(ip<-eps) return "Online_Back";
		if(Xl<Al||fabs(Xl-Al)<eps) return "On_Segment";
		return "Online_Front";
	}
	point Projection(pp a,point x){
		point A=x-a.first,B=a.second-a.first;
		double l=Length(O,B);
		return B*IP(A,B)/(l*l)+a.first;
	}
	point Cross_Point(pp a,pp b){
		point p=Projection(a,b.first),q=Projection(a,b.second);
		double pl=Length(b.first,p),ql=Length(b.second,q);
		string S=Counter_Clockwise(a,b.first),T=Counter_Clockwise(a,b.second);
		if(S==T) return Exterior(b,pl,ql);
		else return Inter(b,pl,ql);
	}
	void Point_in(point& p){
		cin>>p.x>>p.y;
	}
	point solve(VP p){
		point a=Inter(pp(p[0],p[1]),1,1),b=Inter(pp(p[1],p[2]),1,1),c=p[1]-p[0],d=p[2]-p[1];
		return Cross_Point(pp(a,a+Normal(c)),pp(b,b+Normal(d)));
	}
};

double Rounding(double x,int y){
	double tmp=pow(10,y);
	x/=tmp;
	x+=0.5;
	x=(int)x;
	x*=tmp;
	return x;
}

int main(){
	cout<<syosu(3);
	Geom geo;
	cin>>n;
	for(int i=0;i<n;i++){
		for(VP::iterator i=Tri.begin();i!=Tri.end();i++) geo.Point_in(*i);
		point t=geo.solve(Tri);
		cout<<Rounding(t.x,-3)<<' '<<Rounding(t.y,-3)<<' '<<Rounding(geo.Length(Tri[0],t),-3)<<endl;
	}
}