const input=require("fs").readFileSync("/dev/stdin","utf8"),lines=input.trim().split("\n");let array,n,m,index=0,answers=[];for(;line=lines.shift();)if(0===index){const e=line.split(" ").map(Number);n=e[0],m=e[1],index++}else{array=line.split(" ").map(Number);let e=0;for(let i=0;i<n;i++)for(let r=0;r<n;r++){if(i===r)continue;const n=array[i]+array[r];n>e&&n<=m&&(e=n)}index=0,answers.push(e)}answers.forEach(e=>console.log(e||"NONE"));
