#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
vector<unordered_set<int>> g_light;
vector<unordered_set<int>> g_heavy;
vector<int> isHeavy, precalc, isOnline;
int sz(int u) { return g_light[u].size() + g_heavy[u].size(); }
void light2heavy(int u) {
  isHeavy[u] = 1;
  precalc[u] = 0;
  for (int v : g_light[u]) {
    g_light[v].erase(u);
    g_heavy[v].insert(u);
    precalc[u] += isOnline[v];
  }
  for (int v : g_heavy[u]) {
    g_light[v].erase(u);
    g_heavy[v].insert(u);
    precalc[u] += isOnline[v];
  }
}
void heavy2light(int u) {
  isHeavy[u] = 0;
  for (int v : g_light[u]) {
    g_heavy[v].erase(u);
    g_light[v].insert(u);
  }
  for (int v : g_heavy[u]) {
    g_heavy[v].erase(u);
    g_light[v].insert(u);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, q, o;
  cin >> n >> m >> q >> o;
  g_light.assign(n, unordered_set<int>());
  g_heavy.assign(n, unordered_set<int>());
  isHeavy.assign(n, 0);
  precalc.assign(n, 0);
  isOnline.assign(n, 0);
  int SR = ceil(sqrt(n));
  for (int i = 0; i < o; ++i) {
    int aux;
    cin >> aux;
    aux--;
    isOnline[aux] = 1;
  }
  for (int j = 0; j < m; ++j) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    if (isHeavy[u])
      g_heavy[v].insert(u), precalc[u] += isOnline[v];
    else
      g_light[v].insert(u);
    if (isHeavy[v])
      g_heavy[u].insert(v), precalc[v] += isOnline[u];
    else
      g_light[u].insert(v);
    if (sz(u) == SR) light2heavy(u);
    if (sz(v) == SR) light2heavy(v);
  }
  for (int k = 0; k < q; ++k) {
    char typ;
    cin >> typ;
    int u, v;
    if (typ == 'O') {
      cin >> u;
      u--;
      isOnline[u] = 1;
      for (int v : g_heavy[u]) precalc[v]++;
    } else if (typ == 'F') {
      cin >> u;
      u--;
      isOnline[u] = 0;
      for (int v : g_heavy[u]) precalc[v]--;
    } else if (typ == 'A') {
      cin >> u >> v;
      u--;
      v--;
      if (isHeavy[u])
        g_heavy[v].insert(u), precalc[u] += isOnline[v];
      else
        g_light[v].insert(u);
      if (isHeavy[v])
        g_heavy[u].insert(v), precalc[v] += isOnline[u];
      else
        g_light[u].insert(v);
      if (sz(u) == SR) light2heavy(u);
      if (sz(v) == SR) light2heavy(v);
    } else if (typ == 'D') {
      cin >> u >> v;
      u--;
      v--;
      if (isHeavy[u])
        g_heavy[v].erase(u), precalc[u] -= isOnline[v];
      else
        g_light[v].erase(u);
      if (isHeavy[v])
        g_heavy[u].erase(v), precalc[v] -= isOnline[u];
      else
        g_light[u].erase(v);
      if (sz(u) == SR - 1) heavy2light(u);
      if (sz(v) == SR - 1) heavy2light(v);
    } else if (typ == 'C') {
      cin >> u;
      u--;
      if (isHeavy[u])
        cout << precalc[u] << "\n";
      else {
        int ans = 0;
        for (int v : g_heavy[u]) ans += isOnline[v];
        for (int v : g_light[u]) ans += isOnline[v];
        cout << ans << "\n";
      }
    }
  }
}
