#include <iostream>
using namespace std;

int main() {
  int q1, b, c1, c2, q2, n1, n2;

  while (1) { 
    cin >> q1;
    if (!q1) break;

    cin >> b >> c1 >> c2 >> q2;
    if (c1 > c2) {
      n1 = (b - c2 * q1) / (c1 - c2);
      if (n1 > q1) {
        n1 = b / c1;
      }
    } else {
      n1 = b / c1;
    }
    if (n1 > q2) {
      n1 = q2;
    }
    n2 = (b - c1 * n1) / c2;

    if (n1 <= 0) {
      cout << "NA" << endl;
    } else {
      cout << n1 << " " << n2 << endl;
    }
  }

  return 0;
}