const input=require("fs").readFileSync("/dev/stdin","utf8"),lines=input.trim().split("\n"),getMax=(e,t)=>t.reduce((t,i)=>i>t&&i<=e?i:t,0),getHighestPriceSum=(e,t)=>{const s=[];for(i=0;i<t.length;i++){const e=t[i];for(j=0;j<t.length;j++)if(i!==j){const i=t[j];s.push(e+i)}}return getMax(e,s)};let ctr=0;const dataSets=[],objHolder={};for(;line=lines.shift();){if(ctr%2==0){const e=line.split(" ").map(Number)[1];objHolder.budget=e}else{const e=line.split(" ").map(Number);objHolder.priceList=e,dataSets.push(Object.assign({},objHolder))}ctr++}dataSets.forEach(e=>{const{budget:t,priceList:i}=e,s=getHighestPriceSum(t,i);0===s?console.log("NONE"):console.log(s)});
