import Control.Applicative
import Control.Monad (replicateM_)
import Data.Maybe
type Point = (Double, Double)
data Line = Vert Double | Line { slope :: Double
                               , int :: Double
                               } deriving Show 
isVert (Vert _) = True
isVert (Line _ _) = False

data LineSegment = LM { line :: Line
                      , left :: Point
                      , right :: Point
                      } deriving Show

main = do
  n <- readLn
  replicateM_ n solve

solve :: IO ()
solve = do
  [x1,y1,x2,y2,x3,y3] <- map read.words<$>getLine
  let l1 = setLSeg (x1,y1) (x2,y2)
      l2 = setLSeg (x2,y2) (x3,y3)
      [perpl1,perpl2] = map perpendicularDisector [l1,l2]
      c = fromJust $ crossPoint perpl1 perpl2
      r = dist (x1,y1) c
      [x,y,radius] = map ((/1000).fromIntegral.round.(*1000)) [fst c, snd c, r]
  putStrLn $ unwords.map show $ [x,y,radius]


setLine :: Point -> Point -> Line
setLine (x1,y1) (x2,y2) = if (x2 - x1) == 0 then Vert ((x1+x2)/2) else Line a b
  where a = (y2 - y1)/ (x2 - x1)
        b = (x2*y1 - x1*y2) / (x2 - x1)

setLSeg :: Point -> Point -> LineSegment
setLSeg p1 p2 = LM (setLine p1 p2) p1 p2

dist :: Point -> Point -> Double
dist (x1,y1) (x2,y2) = sqrt $ (x2 - x1)^2 + (y2 - y1)^2

perpendicularDisector :: LineSegment -> Line
perpendicularDisector lseg
  | isVert (line lseg) = Line 0 ((y1+y2)/2)
  | (slope.line $ lseg) == 0 = Vert ((x1+x2)/2)
  where p1 = left lseg
        p2 = right lseg
        [x1,x2] = map fst [p1,p2]
        [y1,y2] = map snd [p1,p2]
        midPoint = ((x1+x2)/2, (y1+y2)/2)
        a = (y2 - y1) / (x2 - x1)
        b = a * (fst midPoint) + snd midPoint

crossPoint :: Line -> Line -> Maybe Point
crossPoint l1 l2 
  | (not.isVert $ l1) && (not.isVert $ l2) = equation a (-1) c a' (-1) c
  | isVert l1 = Just (x, a'*x+c')
  | isVert l2 = Just (x', a*x'+c)
  where a = slope l1
        a' = slope l2
        c = int l1
        c' = int l2
        (Vert x) = l1
        (Vert x') = l2

equation a b c a' b' c'
  | a * b' /= a' * b = Just (x,y)
  | otherwise = Nothing
  where det = a*b' - a' * b
        x = (c*b' - c'*b) / det
        y = (a*c' - a'*c) / det