require 'mathn'

STDIN.each_line do |line|
	m = line.split.map(&:to_i).each_slice(3).to_a
	m.reverse! if m[0][0].zero?

	a = m[0][0]
	d = m[1][0]
	1.upto(2) do |i|
		m[0][i] /= a
		m[1][i] -= d * m[0][i]
	end

	y = m[1][2] / m[1][1]
	x = m[0][2] - m[0][1] * y
	puts "%.3f %.3f" % [x, y]
end