import Text.Printf

main :: IO()
main = getContents >>= mapM_ ((\[x, y] -> printf "%.3f %.3f\n" x y) . cramer) . (mapMap read . wordsLines)

cramer :: [Double] -> [Double]
cramer [a, b, p, c, d, q] = map (/ (a * d - b * c)) [p * d - b * q, a * q - p * c]

wordsLines :: String -> [[String]]
wordsLines = map words . lines

mapMap :: (a -> b) -> [[a]] -> [[b]]
mapMap f = map (map f)
