const input=require("fs").readFileSync("/dev/stdin","utf8"),lines=input.trim().split("\n");let i=0,n=2,max=2;for(;line=lines.shift();){if(i%2==0){if([n,max]=line.split(" ").map(Number),0===n&&0===max)break}else{const i=line.split(" ").map(Number);let e=0;for(let t=0;t<n;t++)for(let l=0;l<n;l++){if(!i[t]||!i[l]||t===l)continue;const n=i[t]+i[l];n<=max&&n>e&&(e=n)}console.log(`${e||"NONE"}`)}i++}
