#include <iostream>

using namespace std;

int main()
{
  long int q1, b, c1, c2, q2, s, t, cost, a;
  float f;

  while(1){
    cin >> q1;
    if(q1 == 0){
      break;
    }
    cin >> b >> c1 >> c2 >> q2;

    s = b / c1;
    if(s > q2){
      s = q2;
    }
    t = q1 - s;
    if(t < 0){
      t = 0;
    }
    cost = c1*s + c2*t;
    if(cost > b){
      while(s > 0 && cost > b){
	cost -= c1;
	s--;
      }
    }
    if(s <= 0){
      cout << "NA" << endl;
      continue;
    }
    while(cost+c2 <= b){
      t++; 
      cost += c2;
    }
    if(s+t < q1){
      q1 -= (s+t);
      f = (float)c1/c2;
      a = 1;
      while(f < q1){
	f += f;
	a++;
      }
      s -= a;
      cost -= c1*a;
      cost += ((int)f*c2);
      t += (int)f;
      while(cost+c2 <= b){
	t++; 
	cost += c2;
      }
      if(s+t < q1){
	cout << "NA" << endl;
	continue;
      }
    }
    cout << s << " " << t << endl;
  }

  return 0;
}