#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long double PI = acosl(-1);
const int inf = 1e8;
const long long INF = 1e13;
const int nmax = 5e4 + 5;
const int MAXLG = log2(nmax) + 1;
const int limit = 600;
bool onlin[nmax];
int sodonline[nmax];
unordered_set<int> g[nmax];
unordered_set<int> boro;
void sodoedit(int u, int v) {
  if (g[u].size() <= limit and onlin[u]) sodonline[v]++;
}
void borohoile(int u, int v) {
  if (g[u].size() == limit + 1 and onlin[u])
    for (int x : g[u])
      if (x != v) sodonline[x]--;
  if (g[u].size() == limit + 1) boro.insert(u);
}
void adej(int u, int v) {
  g[u].insert(v), g[v].insert(u);
  sodoedit(u, v), sodoedit(v, u);
  borohoile(u, v), borohoile(v, u);
}
void sodoedit2(int u, int v) {
  if (g[u].size() < limit and onlin[u]) sodonline[v]--;
}
void sodohoile(int u, int v) {
  if (g[u].size() == limit and onlin[u])
    for (int x : g[u])
      if (x != v) sodonline[x]++;
  if (g[u].size() == limit) boro.erase(u);
}
void removej(int u, int v) {
  g[u].erase(v), g[v].erase(u);
  sodoedit2(u, v), sodoedit2(v, u);
  sodohoile(u, v), sodohoile(v, u);
}
int query(int u) {
  int ret = 0;
  for (int v : boro)
    if (onlin[v])
      if (g[v].find(u) != g[v].end()) ret++;
  ret += sodonline[u];
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, q;
  cin >> n >> m >> q;
  int o;
  cin >> o;
  for (int i = 0; i < o; i++) {
    int u;
    cin >> u;
    onlin[u] = true;
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    adej(u, v);
  }
  while (q--) {
    char ch;
    cin >> ch;
    if (ch == 'O') {
      int u;
      cin >> u;
      onlin[u] = true;
      if (g[u].size() <= limit)
        for (int v : g[u]) sodonline[v]++;
    } else if (ch == 'F') {
      int u;
      cin >> u;
      onlin[u] = false;
      if (g[u].size() <= limit)
        for (int v : g[u]) sodonline[v]--;
    } else if (ch == 'A') {
      int u, v;
      cin >> u >> v;
      adej(u, v);
    } else if (ch == 'D') {
      int u, v;
      cin >> u >> v;
      removej(u, v);
    } else {
      int u;
      cin >> u;
      cout << query(u) << "\n";
    }
  }
}
