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