#include<stdio.h>
int dp[1001],n,m,i,j,a[1001],max;
int main()
{
    scanf("%d %d",&n,&m);
    while((m!=0)&&(n!=0))
    {
        max=-1;
        for(i=1;i<=n;i=i+1)
        {
            scanf("%d",&a[i]);
            for(j=1;j<i;j=j+1)
            {
                if(a[i]+a[j]<=m)
                    if(a[i]+a[j]>max)
                      max=a[i]+a[j];
            }
        }
        if(max!=-1)
          printf("%d\n",max);
        else
          printf("NONE\n");
       scanf("%d %d",&n,&m);
    }
    return 0;
}

