while line = STDIN.gets
	if(/exit/ =~ line)
		break
	end
	temp = line.scan(/\d+|-\d+/)
	a = temp[0].to_f
	b = temp[1].to_f
	c = temp[2].to_f
	d = temp[3].to_f
	e = temp[4].to_f
	f = temp[5].to_f
	x = (c*e-b*f)/(a*e-b*d)
	y = (c*d-f*a)/(b*d-e*a)

	print sprintf("%.3f %.3f\n",x,y)
end