#include <bits/stdc++.h>
using namespace std;
const int N = 50111;
int n, m, q, o;
int online[N];
vector<int> s[N];
int ans[N];
void add(int u, int v) {
  if (s[u].size() > s[v].size()) swap(u, v);
  s[u].push_back(v);
  ans[v] += online[u];
}
void update(int u, int val) {
  for (vector<int>::iterator it = s[u].begin(); it != s[u].end(); it++)
    ans[*it] += val;
}
void remove(int u, int v) {
  vector<int>::iterator it;
  if ((it = find(s[u].begin(), s[u].end(), v)) != s[u].end()) {
    s[u].erase(it);
    ans[v] -= online[u];
  }
  if ((it = find(s[v].begin(), s[v].end(), u)) != s[v].end()) {
    s[v].erase(it);
    ans[u] -= online[v];
  }
}
int query(int u) {
  int ret = ans[u];
  for (vector<int>::iterator it = s[u].begin(); it != s[u].end(); it++)
    ret += online[*it];
  return ret;
}
int main() {
  scanf("%d %d %d", &n, &m, &q);
  scanf("%d", &o);
  for (int i = 0; i < o; i++) {
    int tmp;
    scanf("%d", &tmp);
    online[tmp]++;
  }
  for (int i = 0; i < m; i++) {
    int l, r;
    scanf("%d %d", &l, &r);
    add(l, r);
  }
  char op[10];
  int l, r;
  while (q--) {
    scanf("%s", op);
    scanf("%d", &l);
    if (op[0] == 'C') {
      cout << query(l) << endl;
    } else if (op[0] == 'A') {
      scanf("%d", &r);
      add(l, r);
    } else if (op[0] == 'O') {
      online[l] = 1;
      update(l, 1);
    } else if (op[0] == 'F') {
      online[l] = 0;
      update(l, -1);
    } else if (op[0] == 'D') {
      scanf("%d", &r);
      remove(l, r);
    }
  }
  return 0;
}
