#include<iostream>
#include<sstream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<algorithm>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cassert>

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define rp(i,c) rep(i,(c).size())
#define fr(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
#define pb push_back
#define dbg(x) cerr<<#x<<" = "<<(x)<<endl

typedef long long ll;
typedef vector<int> vi;
const int inf=1<<28;
const double INF=1e12,EPS=1e-9;

int main()
{
	int q1,b,c1,c2,q2;
	while(cin>>q1,q1)
	{
		cin>>b>>c1>>c2>>q2;
		int hutuu=0,zidori=0;
		if(c1>c2)
		{
			hutuu=min(q1,b/c2);
			
			int t=(b-hutuu*c2)/(c1-c2);
			t=min(t,min(q2,hutuu));
			hutuu-=t; zidori+=t;
			
			t=min((b-c1*zidori-c2*hutuu)/c1,q2-zidori);
			zidori+=t;
		}
		else
		{
			zidori=min(q1,min(q2,b/c1));
		}
		hutuu+=(b-c1*zidori-c2*hutuu)/c2;
		
		if(zidori+hutuu<q1||zidori==0)
		{
			cout<<"NA"<<endl;
			continue;
		}
		else cout<<zidori<<" "<<hutuu<<endl;
	}
	return 0;
}