You're given the centers of three equal sides of a strictly convex tetragon. Your task is to restore the initial tetragon.
The first input line contains one number *T* — amount of tests (1 ≤ *T* ≤ 5·10<sup class="upper-index">4</sup>). Each of the following *T* lines contains numbers *x*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, *y*<sub class="lower-index">2</sub>, *x*<sub class="lower-index">3</sub>, *y*<sub class="lower-index">3</sub> — coordinates of different points that are the centers of three equal sides (non-negative integer numbers, not exceeding 10).
#codeforces 23d tetragon: math, geometry
import sys
import math

eps=1e-6

def sign(x):
	if (x>eps): return 1
	if (x<-eps): return -1
	return 0

class Vector:
	def __init__(self,x=0,y=0):
		self.x,self.y=x,y
	
	def __add__(self,other):
		return Vector(self.x+other.x, self.y+other.y)
	
	def __sub__(self,other):
		return Vector(self.x-other.x, self.y-other.y)
	
	def __mul__(self,other):
		return Vector(self.x*other, self.y*other)
	
	def __rmul__(self,other):
		return Vector(other*self.x, other*self.y)
	
	def __truediv__(self,other):
		return Vector(self.x/other, self.y/other)
		
	def input(self):
		tmp=tuple(map(lambda x:float(x), input().split()))
		self.x,self.y=tmp[0],tmp[1]
	
	def disp(self):
		print('({},{})'.format(self.x,self.y))
	
	def length(self):
		return (self.x**2 + self.y**2)**0.5
	
	def normal(self):
		return Vector(-self.y, self.x)
	
	def unit(self):
		return self/self.length()
	
	def angle(self):
		return math.atan2(self.y,self.x)

Point=Vector

def cross(a,b): return a.x*b.y - a.y*b.x

def dot(a,b): return a.x*b.x + a.y*b.y

class Line:
	def __init__(self,p,v): self.p,self.v=p,v
	
	def angle(self): return self.v.angle()
	
	def point(self,t): return self.p+t*self.v
	
def intersect(a,b):
	return b.point(cross(b.p-a.p,a.v)/cross(a.v,b.v))

def convex_counter(points):
	n=len(points)
	for i in range(n):
		cur=points[i]
		nxt=points[(i+1)%n]
		sec=points[(i+2)%n]
		if (sign(cross(sec-nxt,cur-nxt))<=0): return 0
	return 1
	
def findTetragon(E,F,G):
	if (sign(cross(E-F,G-F))==0):
		return ['NO']
	if (cross(G-F,E-F)<0):
		E,G=G,E
	Pb=(F+E)/2
	Pc=(F+G)/2
	vb=(F-E).normal()
	vc=(F-G).normal()
	lb=Line(Pb,vb)
	lc=Line(Pc,vc)
	
	tb=cross((2*F-Pc-Pb), vc)/cross(vb,vc)
	B=lb.point(tb)
	C=2*F-B
	A=2*E-B
	D=2*G-C
	
	if convex_counter([A,B,C,D]):
		return ['YES',A,B,C,D]
	else:
		return ['NO']

def readGen(transform):
	while (True):
		n=0
		tmp=input().split()
		m=len(tmp)
		while (n<m):
			yield(transform(tmp[n]))
			n+=1

#sys.stdin=open("23d.in","r")

readint=readGen(int)
n=next(readint)

for i in range(n):
	P=[Point(next(readint),next(readint)) for i in range(3)]
	got=0
	for j in range(3):
		res=findTetragon(P[j],P[(j+1)%3],P[(j+2)%3])
		if (res[0]=='YES'):
			got=1
			print(res[0])
			for k in range(4):
				print("%.9f %.9f "%(res[1+k].x,res[1+k].y),end='')
			print()
			break
	if (not got):
		print('NO')
		print()
	