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

main :: IO ()
main = do
  ls <- map (map read . words) . lines <$> getContents
  forM_ ls $ \xs -> do
    let (x, y) = solveEq (xs!!0) (xs!!1) (xs!!2) (xs!!3) (xs!!4) (xs!!5)
    printf "%.3f %.3f\n" x y

solveEq :: Double -> Double -> Double -> Double -> Double -> Double -> (Double, Double)
solveEq a b c d e f = (x', y')
  where
    det = a*e-b*d
    (x, y) = ((c*e-b*f)/det, (a*f-c*d)/det)
    x' = if x == -0.0 then 0.0 else x
    y' = if y == -0.0 then 0.0 else y