### constant

MAX_INT = (1 << 30)

### main

n, q = gets.strip.split(' ').map{|s| s.to_i}

scores = n.times.map{gets.strip.to_i}
s_scores = scores.sort
#p scores

leaders = []
rmins = Hash.new(0)

q.times do
  query, xstr = gets.strip.split(' ')
  x = xstr.to_i
  #p [query, x]

  case query
  when 'ADD'
    leaders << (x - 1)
    rmins.clear
    #p ["leaders", leaders]
    next
  when 'REMOVE'
    leaders.delete (x - 1)
    rmins.clear
    #p ["leaders", leaders]
    next
  end

  ## CHECK
  if x >= n
    puts 0
    next
  end

  if rmins.empty?
    ls_enum = leaders.map{|i| scores[i]}.sort.to_enum
    ls = -1

    for s in s_scores
      while ! ls.nil? && ls < s
        begin
          ls = ls_enum.next
        rescue
          ls = nil
          break
        end
      end

      r = ls.nil? ? MAX_INT : ls - s
      rmins[r] += 1
    end
  end
  #p rmins

  sum = 0
  for rmin in rmins.keys.sort{|a, b| b <=> a}
    sum += rmins[rmin]
    if sum > x
      puts (rmin >= MAX_INT ? 'NA' : rmin)
      break
    end
  end
end