#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;
int cnt[7];
int main(){
    long les,m,a,c,w;
    while(cin>>les,les){
        cin>>m>>a>>c>>w;
        int ch=0;
        long cc=0;
        int i=0;
        long k=m/a;
        if(m/c<les||k==0){
            cout<<"NA 2"<<endl;
            continue;
        }
        if(k>w)k=w;
        for(i=k;i>0;i--){
            cc=(m-i*a)/c;
            if(cc+i>=les) {
                ch=1;
                break;
            }
        }
        if(ch) cout<<i<<" "<<cc<<endl;
        else cout<<"NA"<<endl;
    }
    return 0;
}
