2.times do
	a = gets.chomp
	b = a.split.map { |i| i.to_i }
	x = (b[4]*b[2]-b[1]*b[5])/(b[0]*b[4]-b[1]*b[3].abs)
	y = (-b[3]*b[2]+b[0]*b[5])/(b[0]*b[4]-b[1]*b[3].abs)
	puts "#{sprintf("%.3f", x.round(3))} #{sprintf("%.3f", y.round(3))}"
end