class Simultaneous
  def initialize(array)
    @f1 = array.slice(0, 3)
    @f2 = array.slice(3, 3)
  end

  attr_accessor :f1, :f2

  def calc
    x = (@f1[2] * @f2[1] - @f1[1] * @f2[2]) / (@f1[0] * @f2[1] - @f1[1] * @f2[0]).to_f
    y = (@f1[2] * @f2[0] - @f1[0] * @f2[2]) / (@f1[1] * @f2[0] - @f1[0] * @f2[1]).to_f
    return [x.round(3), y.round(3)]
  end
end

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