import Data.List
import Data.Char
import Data.Functor
import Text.Printf
import Control.Monad
import qualified Data.ByteString.Char8 as B

getInts :: IO[Int]
getInts = unfoldr (B.readInt . B.dropWhile isSpace) <$> B.getContents

main :: IO()
main = do
  xs <- getInts
  run xs

run :: [Int] -> IO()
run [] = return()
run (a:b:c:d:e:f:xs) = do
  putStrLn . myPrint $ solve a b c d e f
  run xs

myPrint [x, y] = printf "%.3f %.3f" x y

solve a' b' c' d' e' f' = solve' a b c d e f p q
  where a = (fromIntegral a') :: Double
        b = (fromIntegral b') :: Double
        c = (fromIntegral c') :: Double
        d = (fromIntegral d') :: Double
        e = (fromIntegral e') :: Double
        f = (fromIntegral f') :: Double
        p = (fromIntegral $ lcm a' d' `div` a') :: Double
        q = (fromIntegral $ lcm a' d' `div` d') :: Double

solve' a b c d e f p q = [x, y]
  where x = (c - b * y) / a
        y = u / v
        u = c * p - f * q
        v = b * p - e * q