#include <iostream>
using namespace std;

int main()
{
	int q1, b, c1, c2, q2, x, y;

	cin >> q1;

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

		x = q2;

		while (c1 * x + c2 * (q1 - x) > b || c1 * x > b)
			x--;

		if (x <= 0)
			cout << "NA" << endl;
		else {
			y = q1 - x;

			while (c1 * x + c2 * y < b)
				y++;

			if (c1 * x + c2 * y > b)
				y--;

			cout << x << " " << y << endl;
		}

		cin >> q1;
	}

	return 0;
}
