while 1 do
  n,m=gets.split().map!{|i|i.to_i}
  if n==0&&m==0 then break end
  a=gets.split().map!{|i|i.to_i}
  a.slice!(n..a.length)
  a.sort
  max=-1
  n.times do |i|
    (i+1).upto(n-1) do |j|
      if a[i]+a[j]<=m then
        max=a[i]+a[j]
      end
    end
  end
  if max==-1 then puts "NONE"
  else puts max
  end
end
