class Simultaneous
  def initialize(array)
    @formula1 = array.slice(0, 3)
    @formula2 = array.slice(3, 3)
  end

  attr_accessor :formula1, :formula2

  def calc
    x = (@formula1[2] * @formula2[1] - @formula1[1] * @formula2[2]) / (@formula1[0] * @formula2[1] - @formula1[1] * @formula2[0]).to_f
    y = (@formula1[2] * @formula2[0] - @formula1[0] * @formula2[2]) / (@formula1[1] * @formula1[0] - @formula1[0] * @formula2[1]).to_f
    return sprintf("%.3f %.3f", x, y)
  end
end

while data = gets
  puts Simultaneous.new(data.split(" ").map(&:to_i)).calc
end