#include <bits/stdc++.h>
using namespace std;
const int M = 5e4 + 5, LG = 26, SM = 800, inf = 1e9 + 1, mod = 95542721;
bitset<M> g[30000];
bitset<M> o;
bitset<M> tmp;
int ans[M];
int u[3 * M], v[3 * M];
char qt[5 * M];
int qu[5 * M], qv[5 * M], qans[5 * M];
int qted = 0;
int n;
int ofir[M];
bool vaz;
int vz = M / 2;
void ins(int u, int v, bool b) {
  if ((u < vz) ^ vaz) g[u - vaz * vz][v] = b;
  if ((v < vz) ^ vaz) g[v - vaz * vz][u] = b;
}
int main() {
  int ot, m, q;
  scanf("%d%d%d%d", &n, &m, &q, &ot);
  for (int i = 0; i < ot; i++) {
    scanf("%d", ofir + i);
    ofir[i]--;
    o[ofir[i]] = 1;
  }
  for (int i = 0; i < m; i++) {
    scanf("%d%d", u + i, v + i);
    u[i]--;
    v[i]--;
    ins(u[i], v[i], 1);
  }
  for (int i = 0; i < q; i++) {
    scanf("\n%c%d", qt + i, qu + i);
    qu[i]--;
    if (qt[i] == 'O' || qt[i] == 'F') {
      o[qu[i]] = o[qu[i]] ^ 1;
    } else if (qt[i] == 'D' || qt[i] == 'A') {
      scanf("%d", qv + i);
      qv[i]--;
      ins(qu[i], qv[i], qt[i] == 'A');
    } else if (qu[i] < vz) {
      tmp = o & g[qu[i]];
      qans[i] = tmp.count();
    }
  }
  vaz = 1;
  for (int i = 0; i < vz + 10; i++) g[i] &= 0;
  o &= 0;
  for (int i = 0; i < ot; i++) o[ofir[i]] = 1;
  for (int i = 0; i < m; i++) {
    ins(u[i], v[i], 1);
  }
  for (int i = 0; i < q; i++) {
    if (qt[i] == 'O' || qt[i] == 'F') {
      o[qu[i]] = o[qu[i]] ^ 1;
    } else if (qt[i] == 'D' || qt[i] == 'A') {
      ins(qu[i], qv[i], qt[i] == 'A');
    } else if (qu[i] >= vz) {
      tmp = o & g[qu[i] - vz];
      qans[i] = tmp.count();
    }
  }
  for (int i = 0; i < q; i++) {
    if (qt[i] == 'C') printf("%d\n", qans[i]);
  }
}
