loop do
    n, m = gets.split(' ').map(&:to_i)

    break if n == 0 && m == 0

    a = gets.split(' ').map(&:to_i)

    ans = -1

    (0..n-2).each do |i|
        (i+1..n-1).each do |j|
            if a[i] + a[j] <= m
                ans = [a[i] + a[j], ans].max
            end
        end
    end
    puts ans == -1 ? 'NONE' : ans
end
