class Array
  def lcm
    self.inject{|a,b| a.lcm(b)}
  end
end

ARGF.each do |line|
  a,b,c,d,e,f = line.split.map(&:to_i)
  if (a < 0 && d > 0) || (a > 0 && d < 0)
    l = -[a,d].lcm
  else
    l = [a,d].lcm
  end
  y = ((c*(l/a)) - (f*(l/d))) / ((b*(l/a)) - (e*(l/d)))
  x = ((c-(b*y)) / a)
  puts "#{sprintf( "%.3f", x )} #{sprintf( "%.3f", y )}"
end