import Text.Printf
main = getContents >>= mapM_ (fout . circumscribed_circle . fin . map (read::String->Double) . words) . tail . lines
fin [x1,y1,x2,y2,x3,y3]
 | y1 == y2 = [x1,y1,x3,y3,x2,y2]
 | otherwise = [x1,y1,x2,y2,x3,y3]
fout (x,y,r) = printf "%.3f %.3f %.3f" x y r
circumscribed_circle [x1,y1,x2,y2,x3,y3] = (px,py,r)
 where
  px = (v12*x1 - v23*x2 + y2 - y1) / 2 * (v23 - v12)
  py = v12*x1 - v12*px - y1
  r = sqrt $ (x1-px)^2 + (y1-py)^2
  v12 = (x1-x2)/(y2-y1)
  v23 = (x2-x3)/(y3-y2)