#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DEBUG 0
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) if(DEBUG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DEBUG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
using pii = pair<int, int>; using vi = vector<int>;
static const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
static const int MOD = (int)(1e9 + 7);

signed main() {
	for (int q1, b, c1, c2, q2; cin >> q1 >> b >> c1 >> c2 >> q2&&q1;) {
		int money = b;
		int aizu_m = min(q2, money / c1);
		money -= aizu_m*c1;
		int normal_m = money / c2;
		money -= normal_m*c2;
		bool NA = false;
		while (aizu_m + normal_m < q1) {
			if (aizu_m <= 0) {
				NA = true;
				break;
			}
			aizu_m -= 1;
			money += c1;
			int normal_m_add = money / c2;
			normal_m += normal_m_add;
			money -= normal_m_add*c2;
		}
		if (aizu_m == 0)NA = true;
		if (NA) {
			cout << "NA" << endl;
			continue;
		}
		cout << aizu_m << " " << normal_m << endl;
	}
	return 0;
}