#include<bits/stdc++.h>
using namespace std;
struct Point{
double x,y;
Point(double x=0,double y=0) :x(x),y(y){}
};
typedef Point Vector;
Vector operator +(Vector A,Vector B){return Vector(A.x+B.x,A.y+B.y);}
Vector operator -(Vector A,Vector B){return Vector(A.x-B.x,A.y-B.y);}
Vector operator *(Vector A,double p){return Vector(A.x*p,A.y*p);}
Vector operator /(Vector A,double p){return Vector(A.x/p,A.y/p);}
bool operator <(const Point& a,const Point &b){
return a.x<b.x || (a.x==b.x && a.y<b.y);
}
const double eps=1e-10;
int dcmp(double x){
if(fabs(x)<eps) return 0;else return x<0?-1 :1;
}
bool operator == (const Point &a,const Point &b){
return dcmp(a.x-b.x)==0 && dcmp(a.y-b.y)==0;}
double dot(Vector A,Vector B){
return A.x*B.x+A.y*B.y;
}
double length(Vector A){return sqrt(dot(A,A));}
double angle(Vector A,Vector B){
return acos(dot(A,B)/length(A)/length(B));
}
Vector rotate(Vector A,double rad){ //rad正數時表示逆時針 負數時表示順時針
return Vector(A.x*cos(rad)-A.y*sin(rad),A.x*sin(rad)+A.y*cos(rad));
}
//計算向量的單位法線
Vector normal(Vector A){
double l=length(A);
return Vector(-A.y/l,A.x/l);
}
double cross(Vector A,Vector B){
return A.x*B.y-A.y*B.x;
}
double area2(Point A,Point B,Point C){
return cross(B-A,C-A);
}
Point getlineintersection(Point p,Vector v,Point q,Vector w){
Vector u=p-q;
double t=cross(w,u)/cross(v,w);
return p+v*t;
}
double distancetoline(Point P,Point A,Point B){
Vector v1=B-A,v2=P-A;
return fabs(cross(v1,v2)/length(v1));
}
Point getlineprojection(Point P,Point A,Point B){
Vector v=A-B;
return A+v*(dot(v,P-A)/dot(v,v));
}
int n;
Point getD(Point A,Point B,Point C){
Vector v1=C-B;
Vector v5=A-B;
double a1=angle(v5,v1);
Vector v2=rotate(v1,a1/3);
Vector v3=B-C;
double a2=angle(v3,A-C);
Vector v4=rotate(v3,-a2/3);
return getlineintersection(B,v2,C,v4);
}
int main(){
scanf("%d",&n);
Point A,B,C,D,E,F;
while(n--){
scanf("%lf %lf",&A.x,&A.y);
scanf("%lf %lf",&B.x,&B.y);
scanf("%lf %lf",&C.x,&C.y);
D=getD(A,B,C);
E=getD(B,C,A);
F=getD(C,A,B);
printf("%.6lf %.6lf %.6lf %.6lf %.6lf %.6lf\n",D.x,D.y,E.x,E.y,F.x,F.y);
}
}