#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 * 1000 + 10, SQ = 500;
vector<pair<char, pair<int, int> > > temp;
int t[MAXN];
unordered_map<int, bool> mp[MAXN];
bool on[MAXN];
vector<pair<int, int> > ed[2];
int n, m, q, o;
void add() {
  for (int i = 0; i < (int)temp.size(); i++) {
    pair<int, int> a = temp[i].second;
    char ty = temp[i].first;
    if (ty == 'O')
      on[a.first] = true;
    else if (ty == 'F')
      on[a.first] = false;
    else if (ty == 'A') {
      mp[a.first][a.second] = true;
      mp[a.second][a.first] = true;
    } else {
      mp[a.first].erase(a.second);
      mp[a.second].erase(a.first);
    }
  }
  for (int i = 0; i < n; i++) t[i] = 0;
  for (auto a : ed[0]) {
    t[a.first] += on[a.second];
    t[a.second] += on[a.first];
  }
  for (auto a : ed[1]) {
    t[a.first] -= on[a.second];
    t[a.second] -= on[a.first];
  }
  temp.clear();
}
int main() {
  scanf("%d %d %d %d", &n, &m, &q, &o);
  for (int i = 0; i < o; i++) {
    int a;
    scanf("%d", &a);
    on[a - 1] = true;
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    temp.push_back({'A', {a - 1, b - 1}});
    ed[0].push_back({a - 1, b - 1});
  }
  add();
  while (q--) {
    char ty;
    int u, v = -1;
    scanf(" %c %d", &ty, &u);
    u--;
    if (ty == 'C') {
      int ans = t[u];
      for (int i = 0; i < (int)temp.size(); i++) {
        pair<int, int> a = temp[i].second;
        ty = temp[i].first;
        if ((ty == 'O' || ty == 'F')) {
          if (mp[u].find(a.first) != mp[u].end()) ans += ((ty == 'O') ? 1 : -1);
        } else {
          if (a.first != u) swap(a.first, a.second);
          if (a.first == u) ans = ans + ((ty == 'A') ? 1 : -1) * on[a.second];
        }
      }
      printf("%d\n", ans);
    } else {
      if (ty == 'A' || ty == 'D') {
        scanf("%d", &v);
        v--;
        ed[ty == 'D'].push_back({u, v});
      } else if (ty == 'O')
        on[u] = true;
      else
        on[u] = false;
      temp.push_back({ty, {u, v}});
    }
    if ((int)temp.size() > SQ) add();
  }
  return 0;
}
