#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 5;
const double eps = 0;
const int ms = 0;
const int md = 0;
const int mod = 1e9 + 9;
const int pi = 31, pii = 41;
const int base = 1e9;
const int N = 1e5 + 10;
const int NN = 1e5 + 5;
const int M = 1e5 + 5;
const int blocks = 600;
void readfile() {
  freopen("textin.inp", "r", stdin);
  freopen("text.out", "w", stdout);
}
int n, m, q, o;
short onl[N];
int res[N] = {};
unordered_set<int> s[N], heavy;
void create(int u) {
  res[u] = 0;
  for (int v : s[u])
    if (onl[v]) ++res[u];
}
void erase(int u) { res[u] = 0; }
void inp() {
  cin >> n >> m >> q;
  cin >> o;
  for (int i = 1; i <= o; i++) {
    int x;
    cin >> x;
    ;
    onl[x] = 1;
  }
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    ;
    s[u].insert(v);
    s[v].insert(u);
  }
  for (int i = 1; i <= n; i++)
    if ((int)s[i].size() >= blocks) heavy.insert(i);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  inp();
  for (int u : heavy) {
    create(u);
  }
  for (int i = 1; i <= q; i++) {
    char opt;
    cin >> opt;
    int u;
    cin >> u;
    ;
    if (opt == 'A') {
      int v;
      cin >> v;
      ;
      s[u].insert(v);
      s[v].insert(u);
      if (heavy.find(u) != heavy.end()) res[u] += onl[v];
      if (heavy.find(v) != heavy.end()) res[v] += onl[u];
      if ((int)s[u].size() >= blocks && heavy.find(u) == heavy.end()) {
        create(u);
        heavy.insert(u);
      }
      if ((int)s[v].size() >= blocks && heavy.find(v) == heavy.end()) {
        create(v);
        heavy.insert(v);
      }
    } else if (opt == 'D') {
      int v;
      cin >> v;
      ;
      s[u].erase(v);
      s[v].erase(u);
      if ((int)s[u].size() < blocks && heavy.find(u) != heavy.end()) {
        erase(u);
        heavy.erase(u);
      }
      if ((int)s[v].size() < blocks && heavy.find(v) != heavy.end()) {
        erase(v);
        heavy.erase(v);
      }
      if (heavy.find(u) != heavy.end()) res[u] -= onl[v];
      if (heavy.find(v) != heavy.end()) res[v] -= onl[u];
    } else if (opt == 'C') {
      if (heavy.find(u) != heavy.end())
        cout << res[u] << '\n';
      else {
        int kq = 0;
        for (int v : s[u]) kq += onl[v];
        cout << kq << '\n';
      }
    } else if (opt == 'O') {
      onl[u] = 1;
      for (int x : heavy)
        if (s[x].find(u) != s[x].end()) {
          ++res[x];
        }
    } else {
      onl[u] = 0;
      for (int x : heavy)
        if (s[x].find(u) != s[x].end()) {
          --res[x];
        }
    }
  }
  return 0;
}
