include <stdio.h>

int main()
{
	int goods_num_n, max_cost_m;
	int goods_cost_a[1000];
	int n_sum = 0;
	int counter_i, counter_j;
	int buying_goods = 0, buying_max = 0;
	
	for(n_sum = 0 ; n_sum <= 50000 ; n_sum += goods_num_n)
	{
		scanf("%d %d", &goods_num_n, &max_cost_m);
		if(goods_num_n == 0 && max_cost_m == 0)
			break;

		for(counter_i = 0 ; counter_i < goods_num_n ; counter_i++)
		{
			scanf("%d", &goods_cost_a[counter_i]);
		}
		
		for(counter_i = 0 ; counter_i < goods_num_n ; counter_i++)
		{
			if(goods_cost_a[counter_i] >= max_cost_m)
				continue;
			
			for(counter_j = counter_i + 1 ; counter_j < goods_num_n ; counter_j++)
			{
				if(goods_cost_a[counter_j] >= max_cost_m)
					continue;
				
				buying_goods = goods_cost_a[counter_i] + goods_cost_a[counter_j];
				if(buying_goods <= max_cost_m && buying_goods >= buying_max)
					buying_max = buying_goods;
			}
		}
		if(buying_max == 0)
			printf("NONE\n");
		else
			printf("%d\n", buying_max);

		buying_max = 0;
	}
	return 0;
}

