Given the lengths of the edges of a tetrahedron
calculate the radius of a sphere inscribed in that tetrahedron
(i.e. a sphere tangent to all the faces).

Input

An integer t, 1 ≤ t ≤ 30, denoting the number of test cases, followed by t lines, each containing 6 integers describing the lengths of the edges of a tetrahedron
separated by single spaces. The edges are not longer than 1000 and
for the tetrahedron WXYZ, the order of the edges is: WX, WY, WZ, XY, XZ, YZ.

Output

t lines, each consisting of a real number given with four digits decimal precision
equal to the radius of a sphere inscribed in the given tetrahedron.

Example


Input:
2
1 1 1 1 1 1
1000 999 998 5 5 6

Output:
0.2041
1.4189
#!/usr/bin/python
import math;

def eliminate(M,r,c):
	N=[];
	n=len(M);

	for i in xrange(n):	
		if(i==r):
			continue;
		row=[]
		
		for j in xrange(n):
			if(j!=c):
				row.append(M[i][j]);
		N.append(row);

	return N;
	


def det(M):
	n=len(M);
	if(n==0) :
		return 0;
	elif(n==1):
		return M[0][0];

	sign=1
	delta=0
	for i in xrange(len(M)):
		if (M[0][i]!=0):
			delta+=sign*M[0][i]*det(eliminate(M,0,i));
		sign*=-1;

	return delta;


def getMat(size):
	M=[]
	for i in xrange(size):	
		row=[]
		for j in xrange(size):
			row.append(0);
		M.append(row);
	return M;

def printMat(M):
	for i in xrange(len(M)):
		for j in xrange(len(M)):
			print M[i][j],
		print

#Main

def area(a,b,c):
	s=float(a+b+c)/2.0;
	ar= math.sqrt(s*(s-a)*(s-b)*(s-c));	
	#print ar;
	return ar;


M=getMat(5);
for i in xrange(1,5):
	M[0][i]=M[i][0]=1;

#printMat(M);


cases=int(input());
for i in xrange(cases):
	line=raw_input();
	dist=line.split(" ");
	
	for i in xrange(len(dist)):
		dist[i]=int(dist[i]);
		
	

		# dist[0] d12  dist[1] d13  dist[2] d14
		#		dist[3] d23  dist[4] d24
		#				dist[5] d34

	M[1][2]=M[2][1]=dist[0]*dist[0];
	M[1][3]=M[3][1]=dist[1]*dist[1];
	M[1][4]=M[4][1]=dist[2]*dist[2];
		
	M[2][3]=M[3][2]=dist[3]*dist[3];
	M[2][4]=M[4][2]=dist[4]*dist[4];
	M[3][4]=M[4][3]=dist[5]*dist[5];

	X=float(det(M));
	Volume= math.sqrt(X/288.00)
		#    12 13 14                       12 14 24    		13   14 34                        23      24  34
	Surface=area(dist[0], dist[1],dist[3])+area(dist[0],dist[2],dist[4])+area(dist[1], dist[2],dist[5])+ area(dist[3],dist[4],dist[5]);
	#print Volume, Surface;

	Radius=3*Volume/Surface;
	print "%.4f"% round(Radius,4);