class Array
    def bsearch_last_index(l = 0, r = size - 1, &pred)
        return nil if l > r
        c = (l + r) / 2 
        if pred[self[c]]
            bsearch_last_index(c+1, r, &pred) || c
        else
            bsearch_last_index(l, c-1, &pred)
        end 
    end 
end 

loop do
    q1, b, c1, c2, q2 = gets.split.map &:to_i
    break if q1 == 0
    
    x = 0
    if c1 <= c2
        x = [q2, b / c1].min
    else
        x = (0..[q2, b / c1].min).to_a.bsearch_last_index do |x|
            y = (b - c1 * x) / c2
            x <= q2 && x + y >= q1
        end 
        x ||= 0
    end 

    b -= c1 * x
    y = b / c2
    
    if x > 0 && x + y >= q1
        puts "#{x} #{y}" 
    else
        puts 'NA'
    end
end 