object Main extends App {
    val in = io.Source.stdin.getLines.map(_.split(" ").map(_.toInt))
    for (Array(_, m) <- in if m != 0) {
        val as = in.next.toList.zipWithIndex.sortBy(_._1)
        val x = as.take(as.size / 2).map{case (a, i) => as.reverse.find{case (b, j) => a + b <= m && i != j} match {
            case Some(x) => Some(a + x._1)
            case None => None
        }}.flatten
        if (x.size != 0) println(x.max) else println("NONE")
    }
}