import Control.Monad
import Control.Applicative
import Text.Printf

main = do
    n <- readLn
    replicateM_ n $ do
        [x1, y1, x2, y2, x3, y3] <- map read <$> words <$> getLine
        let det2 = 2 * ((x1 - x2)*(y1 - y3) - (y1 - y2)*(x1 - x3))
            a = x1^2 - x2^2 + y1^2 - y2^2
            b = x1^2 - x3^2 + y1^2 - y3^2
            x = ((y1 - y3)*a - (y1 - y2)*b) / det2 :: Double
            y = ((x1 - x2)*b - (x1 - x3)*a) / det2 :: Double
            r = ((x - x1)^2 + (y - y1)^2) ** 0.5   :: Double
        printf "%.3f %.3f %.3f\n" x y r