gets.to_i.times{
	list = []
	a,b,c,d,e,f = gets.split.map(&:to_f)
	aa,bb = a,b
	list << 2*(a-c) << 2*(b-d) << a**2+b**2-c**2-d**2 << 2*(a-e) << 2*(b-f) << a**2+b**2-e**2-f**2
	a,b,c,d,e,f = list
	mul = -a/d
	y = (c+f*mul)/(b+e*mul)
	x = (c-b*y)/a
	puts "#{sprintf("%.3f %.3f %.3f",x+0.0,y+0.0,((x-aa)**2+(y-bb)**2)**0.5+0.0)}"
}