var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr = input.trim().split("\n");
while (true) {
   if (arr[0] == "0 0") break;
   var nm = arr.shift().split(" ").map(Number);
   var m = nm[1];
   var a = arr.shift().split(" ").map(Number);
   a.sort(function(a, b) {
      return b - a;
   });
   var max = 0;
   for (var i = 0; i < a.length - 1; i++) {
      for (var j = i + 1; j < a.length; j++) {
         if (a[i] + a[j] <= m) {
            max = Math.max(max, a[i] + a[j]);
            continue;
         }
      }
   }
   if (max == 0) max = "NONE";
   console.log(max);
}