def perpen_bisec(a,b,c,d)
   #(a,b) (c,d) perpendicular bisector ex+fy=g return [e,f,g]
   e = c - a
   f = d - b
   g = (c**2 + d**2 - a**2 - b**2)/2
   return [e,f,g]
end

def similu_eq(eq1, eq2) #eq1,2=[a,b,c] ax + by = c
   a,b,c = eq1
   d,e,f = eq2
   x = ((b*f-c*e)/(b*d-a*e))
   y = ((c*d-a*f)/(b*d-a*e))
   return [x,y]
end

num = gets.to_i
num.times do
   a,b,c,d,e,f = gets.split(' ').map(&:to_f)
   line1 = perpen_bisec(a,b,c,d)
   line2 = perpen_bisec(c,d,e,f)
   p = similu_eq(line1, line2)
   r = Math.sqrt((p[0] - a)**2 + (p[1] - b)**2)
   p.each do |each|
	  print sprintf("%.3f ", each+0.0)
   end
   print sprintf("%.3f\n", r+0.0)
end