#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <functional>
#include <numeric>
#include <cmath>
#include <cstring>
#include <queue>
#include <set>

using namespace std;

const int INF = 1 << 29;
typedef long long LL;
typedef pair<int, int> P;

int n, q;

int main(void)
{
	while(cin >> n >> q && n)
	{
		vector<LL> stds(n);
		vector<LL> stdsBuf(n);

		for (int i = 0; i < n; i++)
			cin >> stds[i], stdsBuf[i] = stds[i];
		sort(stds.begin(), stds.end());

		multiset<LL> leaders;
		for (int i = 0; i < q; i++)
		{
			string s;
			int num;
			cin >> s >> num;
			if(s[0] == 'A') // Add
			{
				leaders.insert(stdsBuf[--num]);
			}
			else if(s[0] == 'R') // Remove
			{
				leaders.erase(leaders.lower_bound(stdsBuf[--num]));
			}
			else // Check
			{
				LL lb = 0, ub = 1000000001LL;
				while (ub != lb)
				{
					LL mid = (lb + ub) / 2;
					int pos, fails = 0, pre = 0;

					for (multiset<LL>::iterator it = leaders.begin(); it != leaders.end(); it++)
					{
						pos = lower_bound(stds.begin(), stds.end(), *it - mid) - stds.begin();
						fails += max(pos - pre, 0);
						pre = upper_bound(stds.begin(), stds.end(), *it) - stds.begin();
					}
					fails += max(n - pre, 0);
					
					if(fails > num) lb = mid + 1;
					else ub = mid;
				}

				if(ub == 1000000001LL) cout << "NA";
				else cout << lb;
				cout << endl;
			}
		}
	}
	return 0;
}