require 'matrix'

gets.to_i.times do
  x1, y1, x2, y2, x3, y3 = gets.split.map(&:to_f)
  px, py = (Matrix[[2*(x1-x2), 2*(y1-y2)], [2*(x1-x3), 2*(y1-y3)]].inv *
    Matrix[[x1**2+y1**2-x2**2-y2**2], [x1**2+y1**2-x3**2-y3**2]]).to_a.flatten
  r = Math.sqrt((x1-px)**2+(y1-py)**2)
  printf "%.3f %.3f %.3f\n", px, py, r
end