loop do
    _, limit = gets.split.map(&:to_i)
    break if limit == 0
    puts gets
        .split
        .map(&:to_i)
        .combination(2)
        .map {|x, y| x + y}
        .select {|x| x <= limit}
        .max || 'NONE'
end
