#include <bits/stdc++.h>
using namespace std;
struct user {
  bool online;
  vector<int> friends;
  vector<int> heavys;
  int cont;
  void removeFriend(int x) {
    for (unsigned int i = 0; i < friends.size(); i++)
      if (friends[i] == x) {
        friends[i] = friends[friends.size() - 1];
        friends.pop_back();
        break;
      }
  }
  void removeHeavy(int x) {
    for (unsigned int i = 0; i < heavys.size(); i++)
      if (heavys[i] == x) {
        heavys[i] = heavys[heavys.size() - 1];
        heavys.pop_back();
        break;
      }
  }
};
unsigned int root;
user users[50000];
int get(int x) {
  if (users[x].friends.size() >= root) return users[x].cont;
  int cont = 0;
  for (unsigned int i = 0; i < users[x].friends.size(); i++)
    cont += users[users[x].friends[i]].online;
  return cont;
}
void change(int x) {
  users[x].online ^= true;
  for (unsigned int i = 0; i < users[x].heavys.size(); i++)
    users[users[x].heavys[i]].cont += users[x].online ? +1 : -1;
}
void add(int a, int b) {
  users[a].friends.push_back(b);
  if (users[a].friends.size() > root) {
    users[a].cont += users[b].online;
    users[b].heavys.push_back(a);
  }
  if (users[a].friends.size() == root)
    for (unsigned int i = 0; i < users[a].friends.size(); i++) {
      users[a].cont += users[users[a].friends[i]].online;
      users[users[a].friends[i]].heavys.push_back(a);
    }
}
void remove(int a, int b) {
  users[a].removeFriend(b);
  users[a].removeHeavy(b);
  if (users[a].friends.size() >= root) users[a].cont -= users[b].online;
  if (users[a].friends.size() == root - 1) {
    users[a].cont = 0;
    for (unsigned int i = 0; i < users[a].friends.size(); i++)
      users[users[a].friends[i]].removeHeavy(a);
  }
}
int main() {
  int n, m, q, o;
  scanf("%d %d %d", &n, &m, &q);
  root = sqrt(n) + 1;
  scanf("%d", &o);
  while (o--) {
    int temp;
    scanf("%d", &temp);
    change(temp - 1);
  }
  while (m--) {
    int a, b;
    scanf("%d %d", &a, &b);
    add(a - 1, b - 1);
    add(b - 1, a - 1);
  }
  while (q--) {
    int u, v;
    char mode;
    scanf(" %c", &mode);
    if (mode == 'O' or mode == 'F') {
      scanf("%d", &u);
      change(u - 1);
    } else if (mode == 'C') {
      scanf("%d", &u);
      printf("%d\n", get(u - 1));
    } else if (mode == 'A') {
      scanf("%d %d", &u, &v);
      add(u - 1, v - 1);
      add(v - 1, u - 1);
    } else if (mode == 'D') {
      scanf("%d %d", &u, &v);
      remove(u - 1, v - 1);
      remove(v - 1, u - 1);
    }
  }
  return 0;
}
