import std.algorithm;
import std.array;
import std.ascii;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;
void log(A...)(A arg) { stderr.writeln(arg); }
int size(T)(in T s) { return cast(int)s.length; }

void main() {
    bool solve() {
        int n, m; readf("%d %d\n", &n, &m);
        if (n == 0 && m == 0) return false;
        auto as = readln.chomp.split(" ").map!(to!int).array;
        int ans = 0;
        foreach (i, a; as) {
            foreach (j, b; as[i + 1 .. $]) {
                if (a + b <= m) {
                    ans = max(ans, a + b);
                }
            }
        }
        if (ans == 0) {
            writeln("NONE");
        } else {
            writeln(ans);
        }
        return true;
    }
    while (solve()) {}
}