var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.replace(/\n$/,"")).split("\n");
while(true){
   var arr=(Arr.shift()).split(" ").map(Number);
   if(arr[0]==0)break;
   (function(q1, b, c1,  c2, q2){
      var x=0;
      var y=0;
      var flag=true;
      while(b>=c1*(x+1) && (x+1)<=q2)x++;
      while(b>=c1*x+c2*(y+1))y++;
      while(q1>x+y){
         if(x==0 || c1*x+c2*y>b){flag=false;break;}
         x--;
         while(b>=c1*x+c2*(y+1))y++;
      }
      console.log((flag)?x+" "+y:"NA");
   }).apply(null,arr);
}