#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
inline string get() {
  char ch[2000010];
  scanf("%s", ch);
  return ch;
}
inline void read(int *a, int n) {
  for (int i = 0; i < n; i++) a[i] = in();
}
template <class blank>
inline void out(blank x) {
  cout << x << "\n";
  exit(0);
}
template <class blank>
inline void smin(blank &a, blank b) {
  a = min(a, b);
}
template <class blank>
inline void smax(blank &a, blank b) {
  a = max(a, b);
}
const int maxn = 1e5 + 10;
const int maxm = 1e6 + 10;
const int maxlg = 21;
const int base = 29;
const int mod = 1e9 + 7;
const long long INF = 1e18 + 10;
const int SQ = 630;
bool on[maxn];
int deg[maxn];
int cnt[maxn];
unordered_set<int> fr[maxn], heavyFr[maxn];
int32_t main() {
  int n = in(), m = in(), q = in();
  int online = in();
  for (int i = 0; i < online; i++) on[in()] = true;
  for (int i = 0; i < m; i++) {
    int v = in(), u = in();
    deg[v]++, deg[u]++;
    fr[v].insert(u), fr[u].insert(v);
  }
  for (int i = 1; i <= n; i++) {
    if (deg[i] >= SQ) {
      for (auto u : fr[i]) heavyFr[u].insert(i);
    } else {
      for (auto u : fr[i]) cnt[u] += on[i];
    }
  }
  while (q--) {
    char tp = 0;
    do {
      tp = getchar();
    } while (!isalpha(tp));
    if (tp == 'O' || tp == 'F') {
      int id = in();
      on[id] ^= 1;
      if (deg[id] < SQ) {
        for (auto u : fr[id]) cnt[u] += on[id] ? 1 : -1;
      }
    } else if (tp == 'A') {
      int v = in(), u = in();
      if (deg[v] == SQ - 1) {
        for (auto u : fr[v]) {
          heavyFr[u].insert(v);
          cnt[u] += on[v] ? -1 : 0;
        }
      } else if (deg[v] < SQ) {
        cnt[u] += on[v];
      }
      if (deg[v] >= SQ - 1) heavyFr[u].insert(v);
      fr[v].insert(u);
      swap(v, u);
      if (deg[v] == SQ - 1) {
        for (auto u : fr[v]) {
          heavyFr[u].insert(v);
          cnt[u] += on[v] ? -1 : 0;
        }
      } else if (deg[v] < SQ) {
        cnt[u] += on[v];
      }
      if (deg[v] >= SQ - 1) heavyFr[u].insert(v);
      fr[v].insert(u);
      deg[v]++, deg[u]++;
    } else if (tp == 'D') {
      int v = in(), u = in();
      fr[v].erase(u), fr[u].erase(v);
      deg[v]--, deg[u]--;
      if (deg[v] == SQ - 1) {
        for (auto u : fr[v]) {
          heavyFr[u].erase(v);
          cnt[u] += on[v];
        }
      } else if (deg[v] < SQ) {
        cnt[u] -= on[v];
      }
      if (deg[v] >= SQ - 1) heavyFr[u].erase(v);
      swap(v, u);
      if (deg[v] == SQ - 1) {
        for (auto u : fr[v]) {
          heavyFr[u].erase(v);
          cnt[u] += on[v];
        }
      } else if (deg[v] < SQ) {
        cnt[u] -= on[v];
      }
      if (deg[v] >= SQ - 1) heavyFr[u].erase(v);
    } else if (tp == 'C') {
      int id = in();
      int ret = cnt[id];
      for (auto u : heavyFr[id]) ret += on[u];
      printf("%d\n", ret);
    }
  }
}
