const input = require('fs').readFileSync('/dev/stdin', 'utf8');
const lines = input.trim().split('\n');
let i = 0;
let n = 2, max = 2;
while (line = lines.shift()) {
	if (i % 2 === 0) {
		[n, max] = line.split(' ');
		if (n === 0 && max === 0) { break; }
	}
	else {
		const prices = line.split(' ').map(Number);
		let temp = 0;
		for (let i = 0; i <= n; i++) {
			for (let j = 0; j <= n; j++) {
				if (!prices[i] || !prices[j] || i === j) {
					continue;
				}
				const tempCalc = prices[i] + prices[j];

				if (tempCalc <= max && tempCalc > temp) {
					temp = tempCalc;
				}
			}
		}

		console.log(`${temp ? temp : 'NONE'}`);
	}
	i++;
} 

