#include <bits/stdc++.h>
using namespace std;
const int N = 50100, SQ = 400;
unordered_map<int, bool> adj[N], b;
int smlfrn[N];
bool on[N];
int main() {
  int n, m, q, o, u, v;
  char c;
  scanf("%d %d %d %d", &n, &m, &q, &o);
  for (int i = 0; i < o; i++) {
    scanf("%d", &u);
    on[--u] = 1;
  }
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &u, &v);
    adj[--u][--v] = 1;
    adj[v][u] = 1;
  }
  for (int i = 0; i < n; i++)
    if (adj[i].size() < SQ) {
      if (on[i])
        for (auto u : adj[i]) smlfrn[u.first]++;
    } else
      b[i] = 1;
  for (int i = 0; i < q; i++) {
    scanf("%s %d", &c, &u);
    u--;
    if (c == 'A' || c == 'D') {
      scanf("%d", &v);
      v--;
      if (c == 'A') {
        for (int j = 0; j < 2; j++) {
          if (on[u] && !b.count(u)) smlfrn[v]++;
          adj[u][v] = 1;
          swap(u, v);
        }
      } else {
        for (int j = 0; j < 2; j++) {
          if (on[u] && !b.count(u)) smlfrn[v]--;
          adj[u].erase(v);
          swap(u, v);
        }
      }
      for (int j = 0; j < 2; j++) {
        if (adj[u].size() > SQ && !b.count(u)) {
          b[u] = 1;
          if (on[u])
            for (auto x : adj[u]) smlfrn[x.first]--;
        } else if (adj[u].size() < SQ - 10 && b.count(u)) {
          b.erase(u);
          if (on[u])
            for (auto x : adj[u]) smlfrn[x.first]++;
        }
        swap(u, v);
      }
    } else if (c == 'O') {
      on[u] = 1;
      if (!b.count(u))
        for (auto x : adj[u]) smlfrn[x.first]++;
    } else if (c == 'F') {
      on[u] = 0;
      if (!b.count(u))
        for (auto x : adj[u]) smlfrn[x.first]--;
    } else {
      int ans = smlfrn[u];
      for (auto x : b)
        if (on[x.first] && adj[u].count(x.first)) ans++;
      printf("%d\n", ans);
    }
  }
  return 0;
}
