gets.to_i.times{
	x1,y1,x2,y2,x3,y3 = gets.split.map(&:to_f)
	a,b,c,d,e,f = 2*(x1-x2), 2*(y1-y2), x1**2+y1**2-x2**2-y2**2, 2*(x1-x3), 2*(y1-y3), x1**2+y1**2-x3**2-y3**2
	x = (b*f-c*e)/(b*d-a*e)
	y = (c*d-a*f)/(b*d-a*e)
	puts "#{sprintf("%.3f %.3f %.3f",x+0.0,y+0.0,((x-x1)**2+(y-y1)**2)**0.5+0.0)}"
}