loop do
  q1, b, c1, c2, q2 = gets.split.map(&:to_i)
  break if q1.zero?

  aca = q2
  nca = 0
  loop do
    if aca.zero?
      break
    elsif q1 <= nca + aca && aca*c1 + nca*c2 <= b
      break
    elsif aca*c1 + nca*c2 > b
      aca -= 1
      nca = 0
    else
      nca += 1
    end
  end

  nca += 1 while aca*c1 + nca*c2 <= b
  nca -= 1

  if aca.zero?
    puts "NA"
  else
    puts "#{aca} #{nca}"
  end
end