#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
int n, m, q, o, cnt[50005];
bool ol[50005];
set<int> fr[50005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> q >> o;
  for (int i = 0; i < o; i++) {
    int x;
    cin >> x;
    ol[x] = true;
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    if (fr[u].size() > fr[v].size()) swap(u, v);
    fr[u].insert(v);
    cnt[v] += ol[u];
  }
  while (q--) {
    string opt;
    int u, v;
    cin >> opt >> u;
    if (opt[0] == 'O') {
      ol[u] = true;
      for (auto i : fr[u]) {
        ++cnt[i];
      }
    } else if (opt[0] == 'F') {
      ol[u] = false;
      for (auto i : fr[u]) {
        --cnt[i];
      }
    } else if (opt[0] == 'C') {
      int res = cnt[u];
      for (auto i : fr[u]) {
        res += ol[i];
      }
      cout << res << endl;
    } else {
      cin >> v;
      if (opt[0] == 'A') {
        if (fr[u].size() > fr[v].size()) swap(u, v);
        fr[u].insert(v);
        cnt[v] += ol[u];
      } else {
        if (!fr[u].count(v)) swap(u, v);
        fr[u].erase(fr[u].find(v));
        cnt[v] -= ol[u];
      }
    }
  }
  return 0;
}
