#include <bits/stdc++.h>
using namespace std;
const int N = 5e4 + 5;
const int C = 450;
int n, q, o, m, x[N];
vector<int> g[N], h[N];
map<int, int> e[N];
int ct[N];
void add(int u, int v) {
  g[u].push_back(v);
  e[u].insert({v, g[u].size() - 1});
  if (g[u].size() <= C) {
    if (x[u]) ct[v]++;
  }
  if (g[u].size() == C) {
    for (int to : g[u]) {
      if (to > 0) {
        ct[to] -= x[u];
        h[to].push_back(u);
      } else {
        h[-to].push_back(-u);
      }
    }
  }
  if (g[u].size() > C) {
    h[v].push_back(u);
  }
}
void upd(int u, int v) {
  int t = e[u][v];
  g[u][t] *= -1;
  if (g[u].size() < C) {
    if (x[u]) {
      if (g[u][t] > 0)
        ct[v]++;
      else
        ct[v]--;
    }
  } else {
    for (int &to : h[v]) {
      if (abs(to) == u) {
        to *= -1;
        return;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> q;
  cin >> o;
  for (int i = 1; i <= o; i++) {
    int t;
    cin >> t;
    x[t] = 1;
  }
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    add(u, v);
    add(v, u);
  }
  char t;
  for (int i = 1; i <= q; i++) {
    cin >> t;
    if (t == 'O') {
      int v;
      cin >> v;
      x[v] = 1;
      if (g[v].size() < C) {
        for (int to : g[v]) {
          if (to > 0) {
            ct[to]++;
          }
        }
      }
    } else if (t == 'F') {
      int v;
      cin >> v;
      x[v] = 0;
      if (g[v].size() < C) {
        for (int to : g[v]) {
          if (to > 0) {
            ct[to]--;
          }
        }
      }
    } else if (t == 'A') {
      int u, v;
      cin >> u >> v;
      if (!e[u].count(v)) {
        add(u, v);
        add(v, u);
      } else {
        upd(u, v);
        upd(v, u);
      }
    } else if (t == 'D') {
      int u, v;
      cin >> u >> v;
      upd(u, v);
      upd(v, u);
    } else {
      int u;
      cin >> u;
      int ans = ct[u];
      for (int to : h[u]) {
        if (to < 0) continue;
        if (x[to]) ans++;
      }
      cout << ans << "\n";
    }
  }
}
