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