#include <bits/stdc++.h>
using namespace std;
const int B = 500;
const int N = 3e5 + 5;
const int MOD = 1e9 + 7;
const double PI = 2 * acos(0.0);
int online[N], ans[N];
unordered_set<int> heavy, g[N];
void makeHeavy(int u) {
  ans[u] = 0;
  heavy.insert(u);
  for (auto v : g[u]) {
    if (online[v]) ans[u]++;
  }
}
void makeLight(int u) {
  ans[u] = 0;
  if (heavy.find(u) != heavy.end()) heavy.erase(u);
}
int main() {
  int n, m, q, o;
  scanf("%d %d %d %d", &n, &m, &q, &o);
  for (int i = 0; i < o; i++) {
    int x;
    scanf("%d", &x);
    online[x] = 1;
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    g[u].insert(v);
    g[v].insert(u);
  }
  for (int i = 1; i <= n; i++) {
    if (g[i].size() >= B) makeHeavy(i);
  }
  while (q--) {
    char x;
    cin >> x;
    if (x == 'O') {
      int u;
      scanf("%d", &u);
      online[u] = 1;
      for (auto i : heavy) {
        if (g[u].find(i) != g[u].end()) ans[i]++;
      }
    } else if (x == 'F') {
      int u;
      scanf("%d", &u);
      online[u] = 0;
      for (auto i : heavy) {
        if (g[u].find(i) != g[u].end()) ans[i]--;
      }
    } else if (x == 'A') {
      int u, v;
      scanf("%d %d", &u, &v);
      g[u].insert(v);
      g[v].insert(u);
      if (g[u].size() == B) {
        makeHeavy(u);
      } else if (g[u].size() > B) {
        ans[u] += online[v];
      }
      if (g[v].size() == B) {
        makeHeavy(v);
      } else if (g[v].size() > B) {
        ans[v] += online[u];
      }
    } else if (x == 'D') {
      int u, v;
      scanf("%d %d", &u, &v);
      g[u].erase(v);
      g[v].erase(u);
      if (g[u].size() < B) {
        makeLight(u);
      } else if (online[v]) {
        ans[u]--;
      }
      if (g[v].size() < B) {
        makeLight(v);
      } else if (online[u]) {
        ans[v]--;
      }
    } else {
      int u;
      scanf("%d", &u);
      if (heavy.find(u) != heavy.end()) {
        printf("%d\n", ans[u]);
      } else {
        int cnt = 0;
        for (auto v : g[u])
          if (online[v]) cnt++;
        printf("%d\n", cnt);
      }
    }
  }
  return 0;
}
