import java.util.*;

class Spy implements Comparable<Spy> {
    public int c;
    public int i;

    public Spy(int c, int i) {
        this.c = c;
        this.i = i;
    }

    public int compareTo(Spy o) {
        return this.c - o.c;
    }
}

public class spiesvsspies_ls {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int m = in.nextInt();

        HashMap<Integer, TreeSet<Spy>> rows = new HashMap<>();
        HashMap<Integer, TreeSet<Spy>> cols = new HashMap<>();

        boolean[] elim = new boolean[n];

        int[][] points = new int[n][2];

        for (int i=0;i<n;++i) {
            int x = in.nextInt();
            int y = in.nextInt();

            points[i][0] = x;
            points[i][1] = y;

            if (!rows.containsKey(y)) rows.put(y, new TreeSet<>());
            if (!cols.containsKey(x)) cols.put(x, new TreeSet<>());

            rows.get(y).add(new Spy(x, i));
            cols.get(x).add(new Spy(y, i));
        }

        while (m --> 0) {
            int i = in.nextInt()-1;
            char c = in.next().charAt(0);

            if (elim[i]) {
                System.out.println("ignore");
                continue;
            }

            Iterator<Spy> it = null;
            ArrayList<Integer> ans = new ArrayList<>();

            if (c == 'S') {
                it = cols.get(points[i][0]).headSet(new Spy(points[i][1], 0), false).descendingIterator();
            } else if (c == 'E') {
                it = rows.get(points[i][1]).tailSet(new Spy(points[i][0], 0), false).iterator();
            } else if (c == 'N') {
                it = cols.get(points[i][0]).tailSet(new Spy(points[i][1], 0), false).iterator();
            } else if (c == 'W') {
                it = rows.get(points[i][1]).headSet(new Spy(points[i][0], 0), false).descendingIterator();
            }

            while (it.hasNext()) {
                Spy rem = it.next();
                i = rem.i;
                elim[i]=true;
                ans.add(i);

                int x = points[i][0];
                int y = points[i][1];

                if (c == 'E' || c == 'W') cols.get(x).remove(new Spy(y, i));
                else rows.get(y).remove(new Spy(x, i));

                it.remove();
            }

            System.out.print(ans.size());
            for (var cur : ans) System.out.print(" " + (cur+1));
            System.out.println();
        }

    }
}