while true
    n, m = gets.chomp.split.map(&:to_i)
    break if [n, m] == [0, 0]
    arr = gets.chomp.split.map(&:to_i)
    max = nil
    arr.combination(2){|x, y| max = x + y if (max.nil? || max < x + y) && x + y <= m}
    puts max.nil? ? "NONE" : max
end
