#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int q1, b, c1, c2, q2;
        cin >> q1 >> b >> c1 >> c2 >> q2;
        if(q1 == 0)
            return 0;

        int x = 0;
        int y = q2;
        while(x != y){
            int z = (x + y + 1) / 2;
            if(b - z*c1 >= 0 && (b - z*c1) / c2 >= q1 - z)
                x = z;
            else
                y = z-1;
        }

        if(x == 0)
            cout << "NA" << endl;
        else
            cout << x << ' ' << ((b - x*c1) / c2) << endl;
    }
}