import scala.io.StdIn
import java.util.Arrays

object Main {
  def main(args: Array[String]): Unit = {
    while(true) {
      val n :: m :: _res = StdIn.readLine().split(" ").map(_.toInt).toList
      if(n == 0) { return; }
      val prices = StdIn.readLine().split(" ").map(_.toInt).toSeq

      println(solve(m, prices).map(_.toString).getOrElse("NONE"))
    }
  }

  def solve(max: Int, prices: Seq[Int]): Option[Int] = {
    val ps = prices.toArray
    Arrays.sort(ps)

    var current: Int = 0

    for {
      (p, i) <- ps.zipWithIndex
      (q, j) <- ps.zipWithIndex
      if i < j
    } {
      val add = p + q
      if(add <= max) {
        if(current < add) {
          current = add
        }
      }
    }

    if(current == 0) {
      None
    } else {
      Some(current)
    }
  }
}

