#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int main(void){
  while(1){
    int q1,b,c1,c2,q2,p,n;
    cin >> q1;
    if(!q1)break;
    cin >> b >> c1 >> c2 >> q2;
    p = min(b/c1,q2);
    b -= p*c1;
    n = b/c2;
    b -= n*c2;
    int f=0;
    while(p){
      if(p+n >= q1){
	f=1;
	break;
      }
      p--;
      b+=c1;
      int t = b/c2;
      n+=t;
      b-=t*c2;
    }
    if(f){
      cout << p << ' ' << n << endl;
    } else {
      cout << "NA" << endl;
    }
  }
}