import Data.Fixed (Milli)

kai :: [Milli] -> String
kai [a,b,p,c,d,q]  = unwords $ map show
                   [(p*d - b*q)/(a*d - b*c)
                   ,(a*q - p*c)/(a*d - b*c)]

outp n s = do
  if (length s) <= n then return ()
  else do
    putStrLn $ kai $ s !! n
    outp (n + 1) s

main = do
  s <- getContents
  let s' = map (map (read :: String -> Milli)) $ (map words. lines) s

  outp 0 s'