require 'scanf'

n = gets.to_i
n.times{
    x1, y1, x2, y2, x3, y3 = gets.scanf("%f %f %f %f %f %f ")
    
    dnm = (2*x2*y3-2*x1*y3+(2*x1-2*x3)*y2+(2*x3-2*x2)*y1)
    numx = -(y2*(y3**2-y1**2+x3**2-x1**2)+y1*((-y3**2)-x3**2+x2**2)+y1**2*y3-x2**2*y3+x1**2*y3+y2**2*(y1-y3))
    numy = (x2*(y3**2+x3**2-x1**2)+x1*((-y3**2)-x3**2)+(x1-x3)*y2**2+(x3-x2)*y1**2+x1**2*x3+x2**2*(x1-x3))

    x = numx / dnm
    y = numy / dnm

    r = Math.sqrt( (x1 - x) ** 2 + (y1 - y)**2)

    print "%.3f %.3f %.3f\n" % [x, y, r]

    # p numx, numy, dnm

}