while n = gets
  s = n.split(" ").map(&:to_f)
  x = (s[2] * s[4] - s[1] * s[5]) / (s[0] * s[4] - s[1] * s[3])
  y = (s[2] - s[0] * x) / s[1]
  x = 0.0 if x.zero?
  y = 0.0 if y.zero?
  printf("%.3f %.3f\n", x, y)
end