module Main where
 
import Control.Applicative
import Control.Monad
import Data.List
import Data.Array
import Text.Printf

isRectangle [a,b,c]
  | a * a + b * b == c * c = "YES"
  | b * b + c * c == a * a = "YES"
  | a * a + c * c == b * b = "YES"
  | otherwise = "NO"

solve [a,b,c,d,e,f] = [x,y] where
  det = a * e - b * d
  x = (c * e - b * f) / det
  y = (a * f - c * d) / det

printAns [x,y] = printf "%.3f %.3f\n" xx yy
  where
    xx = if x == (-0.0) then 0.0 else x
    yy = if y == (-0.0) then 0.0 else y

main :: IO ()
main = do
    _ <- getLine
    ns <- fmap (fmap (read :: String -> Float) . words) . lines <$> getContents
    -- ns <- fmap (fmap (read :: String -> Float) . words) . lines <$> (return "2 -1 -3 1 -1 -3\n2 -1 -3 -9 9 27\n1 2 3 4 5 6\n2 -1 -2 -1 -1 -5")
    forM_ [0..length ns - 1] $ \i -> do
      printAns $ solve (ns !! i)