#function definition
def solver(arr)
   a = arr[0..2]
   b = arr[3..5]
   t = a[0]
   a.map!{|i| i * b[0]}
   b.map!{|i| i * t}
   0.upto(2) do |i|
      a[i] = a[i] - b[i]
   end
   y = (a[2] / a[1]).round
   x = ((arr[2] - arr[1] * y) / arr[0]).round
   printf("%0.3f %0.3f\n", x, y)
end

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

arr.each do |i|
   c = i.split(" ")
   c.map!{|i| i.to_f}
   solver(c)
end