#include<stdio.h>
#include<stdlib.h>

int main(void){
  int n,m,i,j,sum,k=0,max;
  int a[1000],b[1000];
  while(1){
    max = 0;
    scanf("%d",&n);
    scanf("%d",&m);
    if(n == 0 && m == 0){
      break;
    }
    for(i=0;i<n;i++){
      scanf("%d",&a[i]);
    }
    for(i=0;i<n;i++){
      for(j=0;j<n;j++){
	if(i != j){
	  sum = a[i] + a[j];
	  if(sum > max && sum <= m){
	    max = sum;
	    b[k]=max;
	    k++;
	  }
	}
      }
    }
  }
  for(i=0;i<k;i++){
    if(b[i] == 0){
      printf("NONE\n");
    }else{
      printf("%d\n",b[i]);
    }
  }
return 0;
}

