while s=gets do
	break if s.size < 5
	
	q1, b, c1, c2, q2 = s.split().map(&:to_i)
	
	if b < (q1-1)*c2 + c1
		puts "NA"
		next
	end
	
	if b >= q1*c1
		r1 = [b/c1, q2].min
	else
		r2 = q1
		s = c1 - c2
		b2 = b - q1*c2
		r1 = [b2/s, q2].min
	end
	
	b -= c1*r1
	r2 = b/c2
	puts "#{r1} #{r2}"
end