
import           Control.Applicative
import           Control.Monad
import           Data.List
import           Text.Printf

det []=   1
det (h:t) = foldr1 (-) [v*det [take i l ++ drop (i+1) l | l<-t] | (i,v)<-zip [0..] h]

main :: IO ()
main = do
  n <- readLn
  pts<- replicateM n getLine
  mapM_ (process . map (read :: String -> Double) . words) pts
    where
      process::[Double]->IO()
      process [x1,y1,x2,y2,x3,y3] = printf "%.3f %.3f %.3f\n" (rnd x) (rnd y) (rnd r)
        where
          det0 = det [[x1,y1,1],[x2,y2,1],[x3,y3,1]]
          x = det [[x1^2+y1^2,y1,1],[x2^2+y2^2,y2,1],[x3^2+y3^2,y3,1]] / 2.0 / det0
          y = det [[x1,x1^2+y1^2,1],[x2,x2^2+y2^2,1],[x3,x3^2+y3^2,1]] / 2.0 / det0
          r = sqrt ((x-x1)^2+(y-y1)^2)
          rnd val
            | abs val < 0.0005 = 0.0
            | otherwise = val

