
require "matrix"

#main
arr = Array.new
while line = gets
   arr << line
end

arr.each do |i|
   c = i.split(" ")
   c.map!{|i| i.to_f}
   a = Matrix[[c[0], c[1]],
              [c[3], c[4]]]
   b = Vector[c[2],
              c[5]]
   res = a.inverse * b
   printf("%.3f %.3f\n", res[0], res[1]);
end