#include <bits/stdc++.h>
using namespace std;
int n, m, q, o;
bool in[50005] = {};
vector<int> edge[50005];
vector<int> rem[50005];
vector<int> bigf[50005];
int sum[50005];
bool big[50005];
int main() {
  scanf("%d %d %d", &n, &m, &q);
  scanf("%d", &o);
  for (int i = 0; i < o; i++) {
    int x;
    scanf("%d", &x);
    in[x] = true;
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    edge[x].push_back(y);
    edge[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    if (edge[i].size() >= 13) {
      big[i] = true;
      for (int j = 0; j < edge[i].size(); j++) {
        sum[i] += in[edge[i][j]];
        bigf[edge[i][j]].push_back(i);
      }
    }
  }
  while (q--) {
    char qr;
    scanf(" %c", &qr);
    if (qr == 'O') {
      int ql;
      scanf("%d", &ql);
      in[ql] = true;
      {
        for (int i = 0; i < bigf[ql].size(); i++) {
          sum[bigf[ql][i]]++;
        }
        for (int i = 0; i < rem[ql].size(); i++) {
          if (big[rem[ql][i]]) sum[rem[ql][i]]--;
        }
      }
    } else if (qr == 'F') {
      int ql;
      scanf("%d", &ql);
      in[ql] = false;
      {
        for (int i = 0; i < bigf[ql].size(); i++) {
          sum[bigf[ql][i]]--;
        }
        for (int i = 0; i < rem[ql].size(); i++) {
          if (big[rem[ql][i]]) sum[rem[ql][i]]++;
        }
      }
    } else if (qr == 'A') {
      int u, v;
      scanf("%d%d", &u, &v);
      edge[u].push_back(v);
      edge[v].push_back(u);
      if (big[u]) {
        bigf[v].push_back(u);
        sum[u] += in[v];
      }
      if (big[v]) {
        bigf[u].push_back(v);
        sum[v] += in[u];
      }
      if (edge[u].size() + rem[u].size() >= 13 && !big[u]) {
        big[u] = true;
        for (int i = 0; i < edge[u].size(); i++) sum[u] += in[edge[u][i]];
        for (int i = 0; i < rem[u].size(); i++) sum[u] -= in[rem[u][i]];
        for (int i = 0; i < edge[u].size(); i++) bigf[edge[u][i]].push_back(u);
      }
      if (edge[v].size() + rem[v].size() >= 13 && !big[v]) {
        big[v] = true;
        for (int i = 0; i < edge[v].size(); i++) sum[v] += in[edge[v][i]];
        for (int i = 0; i < rem[v].size(); i++) sum[v] -= in[rem[v][i]];
        for (int i = 0; i < edge[v].size(); i++) bigf[edge[v][i]].push_back(v);
      }
    } else if (qr == 'D') {
      int u, v;
      scanf("%d%d", &u, &v);
      rem[u].push_back(v);
      rem[v].push_back(u);
      if (big[u]) {
        sum[u] -= in[v];
      }
      if (big[v]) {
        sum[v] -= in[u];
      }
      if (edge[u].size() + rem[u].size() >= 13 && !big[u]) {
        big[u] = true;
        for (int i = 0; i < edge[u].size(); i++) sum[u] += in[edge[u][i]];
        for (int i = 0; i < rem[u].size(); i++) sum[u] -= in[rem[u][i]];
        for (int i = 0; i < edge[u].size(); i++) bigf[edge[u][i]].push_back(u);
      }
      if (edge[v].size() + rem[v].size() >= 13 && !big[v]) {
        big[v] = true;
        for (int i = 0; i < edge[v].size(); i++) sum[v] += in[edge[v][i]];
        for (int i = 0; i < rem[v].size(); i++) sum[v] -= in[rem[v][i]];
        for (int i = 0; i < edge[v].size(); i++) bigf[edge[v][i]].push_back(v);
      }
    } else {
      int ql;
      scanf("%d", &ql);
      if (big[ql])
        printf("%d\n", sum[ql]);
      else {
        int res = 0;
        for (int i = 0; i < edge[ql].size(); i++) res += in[edge[ql][i]];
        for (int i = 0; i < rem[ql].size(); i++) res -= in[rem[ql][i]];
        printf("%d\n", res);
      }
    }
  }
}
