from collections import defaultdict, deque

n, m = map(int, input().split())
locations = [tuple(map(int, input().split())) for _ in range(n)]

unsorted_rows = defaultdict(list)
unsorted_cols = defaultdict(list)
for idx, (x, y) in enumerate(locations):
  unsorted_cols[x].append((y, idx))
  unsorted_rows[y].append((x, idx))

sorted_rows = {}
sorted_cols = {}
for row in unsorted_rows:
  sorted_rows[row] = deque((a, b) for a, b in sorted(unsorted_rows[row]))
for col in unsorted_cols:
  sorted_cols[col] = deque((a, b) for a, b in sorted(unsorted_cols[col]))

eliminated = set()
for _ in range(m):
  t, d = input().split()
  t = int(t)
  if t - 1 in eliminated:
    print("ignore")
    continue
  x, y = locations[t - 1]
  to_eliminate = []
  if d == 'N':
    while sorted_cols[x][-1][0] > y:
      y2, idx = sorted_cols[x].pop()
      if idx not in eliminated:
        to_eliminate.append(idx)
  if d == 'S':
    while sorted_cols[x][0][0] < y:
      y2, idx = sorted_cols[x].popleft()
      if idx not in eliminated:
        to_eliminate.append(idx)
  if d == 'E':
    while sorted_rows[y][-1][0] > x:
      x2, idx = sorted_rows[y].pop()
      if idx not in eliminated:
        to_eliminate.append(idx)
  if d == 'W':
    while sorted_rows[y][0][0] < x:
      x2, idx = sorted_rows[y].popleft()
      if idx not in eliminated:
        to_eliminate.append(idx)

  eliminated.update(to_eliminate)
  if to_eliminate:
    print(len(to_eliminate), *[i+1 for i in reversed(to_eliminate)])
  else:
    print(0)
