#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> PI;
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define FOR(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

ll q1,b,c1,c2,q2;

main(){
  while(cin>>q1,q1){
    cin>>b>>c1>>c2>>q2;

    if(c1<=c2){
      ll aizu=b/c1,n=0;
      b-=aizu*c1;
      if(aizu>q2){
        b+=(aizu-q2)*c1;
        aizu=q2;
        n=b/c2;
      }
      if(aizu+n<q1 || aizu<1){
        puts("NA");
        goto END;
      }
      cout<<aizu<<" "<<n;
    }else{
      if(b<c1){
        puts("NA");
        goto END;
      }
      ll aizu=1,n=(b-c1)/c2;
      b-=c1+n*c2;
      if(aizu+n<q1){
        puts("NA");
        goto END;
      }

      while(aizu+n>=q1 && aizu<=q2 && n>=0){
        while(b<c1){
          n--;
          b+=c2;
        }
        ++aizu;
        b-=c1;
      }

      --aizu;
      b+=c1;
      n+=b/c2;
      if(aizu<1 || aizu+n<q1){
        puts("NA");
      }else{
        cout<<aizu<<" "<<n<<endl;
      }
    }
END:;
  }
}