#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;

        if((b - c1) / min(c1, c2) < q1 - 1)
            cout << "NA" << endl;
        else{
            int x = 1;
            int y = q2;
            int tmp = 0;
            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;
                ++ tmp;
                if(tmp > 1000)
                    break;
            }
            cout << x << ' ' << ((b - x*c1) / c2) << endl;
        }
    }
}