#include <iostream>
#include <algorithm>
using namespace std;
int main(){
    while(1){
        int q1, b, c1, c2, q2;
        cin >> q1;
        if(q1 == 0) break;
        cin >> b >> c1 >> c2 >> q2;

        int n1 = min(b/c1,q2);
        int n2 = max((b-n1*c1)/c2,0);
        while(1){
            if(n1 <= 0) {
                cout << "NA" << endl;
                break;
            }
            if( q1 <= n1 + n2 ) {
                cout << n1 << ' ' << n2 << endl;
                break;
            }
            n1--;
            n2 = (b-n1*c1)/c2;
        }
    }
    return 0;
}