User ainta decided to make a new instant messenger called "aintalk". With aintalk, each user can chat with other people. User ainta made the prototype of some functions to implement this thing.
 1.  login(*u*): User *u* logins into aintalk and becomes online. 1.  logout(*u*): User *u* logouts and becomes offline. 1.  add_friend(*u*, *v*): User *u* and user *v* become friends. It means, *u* and *v* can talk with each other. The friendship is bidirectional. 1.  del_friend(*u*, *v*): Unfriend user *u* and user *v*. It means, *u* and *v* cannot talk with each other from then. 1.  count_online_friends(*u*): The function returns the number of friends of user *u* who are online at the moment. 
Because the messenger is being tested by some users numbered from 1 to *n*, there is no register method. This means, at the beginning, some users may be online, and some users may have friends.

User ainta is going to make these functions, but before making the messenger public, he wants to know whether he is correct. Help ainta verify his code.
The first line contains three space-separated integers *n*, *m* and *q* (1 ≤ *n* ≤ 50000; 1 ≤ *m* ≤ 150000; 1 ≤ *q* ≤ 250000) — the number of users, the number of pairs of friends, and the number of queries.

The second line contains an integer *o* (1 ≤ *o* ≤ *n*) — the number of online users at the beginning. The third line contains *o* space-separated integers *x*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, ..., *x*<sub class="lower-index">*o*</sub> (1 ≤ *x*<sub class="lower-index">*i*</sub> ≤ *n*) — the ids of the online users. It is guaranteed that these values are distinct.

Each of the next *m* lines contains two space-separated integers *a*<sub class="lower-index">*i*</sub> and *b*<sub class="lower-index">*i*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub>, *b*<sub class="lower-index">*i*</sub> ≤ *n*; *a*<sub class="lower-index">*i*</sub> ≠ *b*<sub class="lower-index">*i*</sub>) — the ids of two users who are friends at the beginning. It is guaranteed there are no multiple friendship given in the input. Note that the friendship is bidirectional.

Next *q* lines describe the *q* queries in the format:
 -  "O *u*" (1 ≤ *u* ≤ *n*) : Call online(*u*). It is guaranteed that user *u* was offline just before the function call. -  "F *u*" (1 ≤ *u* ≤ *n*) : Call offline(*u*). It is guaranteed that user *u* was online just before the function call. -  "A *u* *v*" (1 ≤ *u*, *v* ≤ *n*; *u* ≠ *v*) : Call add_friend(*u*, *v*). It is guaranteed that these two users weren't friends just before the function call. -  "D *u* *v*" (1 ≤ *u*, *v* ≤ *n*; *u* ≠ *v*) : Call del_friend(*u*, *v*). It is guaranteed that these two users were friends just before the function call. -  "C *u*" (1 ≤ *u* ≤ *n*) : Call count_online_friends(*u*) and print the result in a single line.
# https://codeforces.com/contest/398/problem/D
# Dividing graph into heavy and light vertices which are solved with different methods

def main():
    
    n,m,q=readIntArr()
    o_=int(input()) # online user cnts at the start
    isOnline=[False]*(n+1)
    for u in readIntArr(): # read online users
        isOnline[u]=True
    
    adj=[set() for _ in range(n+1)]
    for _ in range(m):
        u,v=readIntArr()
        adj[u].add(v)
        adj[v].add(u)
    
    # split nodes to heavy and light
    # nodes with degree>=B shall be heavy nodes
    # store direct answer of heavy nodes
    
    B=int(pow(n,0.5))+1 # threshold for heavy nodes
    heavyNodes=set()
    precomputedHeavyAns=[0]*(n+1)
    
    # deal with initially heavy nodes
    for node in range(1,n+1):
        isHeavy=(len(adj[node])>=B)
        if isHeavy:
            heavyNodes.add(node)
            activeNeighbours=0
            for v in adj[node]:
                if isOnline[v]:
                    activeNeighbours+=1
            precomputedHeavyAns[node]=activeNeighbours
    
    queries=[]
    for _ in range(q):
        arr=input().split()
        arr[0]=arr[0].decode('utf-8')
        for i in range(1,len(arr)):
            arr[i]=int(arr[i])
        queries.append(arr)
    
    
    def isHeavy(node):
        return node in heavyNodes
    def updateAfterAdd(node):
        isHeavy=(len(adj[node])==B) # node just became heavy
        if isHeavy:
            heavyNodes.add(node)
            activeNeighbours=0
            for v in adj[node]:
                if isOnline[v]:
                    activeNeighbours+=1
            precomputedHeavyAns[node]=activeNeighbours
        return None
    def updateAfterRemove(node):
        isNotHeavy=(len(adj[node])==B-1) # node just became light
        if isNotHeavy:
            heavyNodes.remove(node)
        return None
    def addEdge(u,v):
        adj[u].add(v)
        adj[v].add(u)
        if isHeavy(u) and isOnline[v]:
            precomputedHeavyAns[u]+=1
        if isHeavy(u) and isOnline[u]:
            precomputedHeavyAns[v]+=1
        updateAfterAdd(u)
        updateAfterAdd(v)
        return None
    def removeEdge(u,v):
        adj[u].remove(v)
        adj[v].remove(u)
        if isHeavy(u) and isOnline[v]:
            precomputedHeavyAns[u]-=1
        if isHeavy(u) and isOnline[u]:
            precomputedHeavyAns[v]-=1
        updateAfterRemove(u)
        updateAfterRemove(v)
        return None
    def goOnline(u):
        isOnline[u]=True
        for node in heavyNodes:
            if u in adj[node]:
                precomputedHeavyAns[node]+=1
        return None
    def goOffline(u):
        isOnline[u]=False
        for node in heavyNodes:
            if u in adj[node]:
                precomputedHeavyAns[node]-=1
        return None
    def countOnlineFriends(u):
        if u in heavyNodes:
            return precomputedHeavyAns[u]
        else:
            cnts=0
            for v in adj[u]:
                if isOnline[v]:
                    cnts+=1
            return cnts
    
    queryUtil={
        'O':lambda u:goOnline(u),
        'F':lambda u:goOffline(u),
        'A':lambda u,v:addEdge(u,v),
        'D':lambda u,v:removeEdge(u,v),
        'C':lambda u:countOnlineFriends(u),
        }
    
    def queryHandler(query):
        qType=query[0]
        rest=query[1:]
        return queryUtil[qType](*rest)
    
    # print('heavyNodes:{}'.format(heavyNodes))
    for query in queries:
        res=queryHandler(query)
        if res!=None:
            print(res)
        # print('query:{} heavyNodes:{} adj:{} isOnline:{} precompu:{}'.format(
        #     query,heavyNodes,adj,isOnline,precomputedHeavyAns))
        
    
    return


import sys
input=sys.stdin.buffer.readline #FOR READING PURE INTEGER INPUTS (space separation ok)
# input=lambda: sys.stdin.readline().rstrip("\r\n") #FOR READING STRING/TEXT INPUTS.

def oneLineArrayPrint(arr):
    print(' '.join([str(x) for x in arr]))
def multiLineArrayPrint(arr):
    print('\n'.join([str(x) for x in arr]))
def multiLineArrayOfArraysPrint(arr):
    print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))
 
def readIntArr():
    return [int(x) for x in input().split()]
# def readFloatArr():
#     return [float(x) for x in input().split()]
 
def makeArr(defaultValFactory,dimensionArr): # eg. makeArr(lambda:0,[n,m])
    dv=defaultValFactory;da=dimensionArr
    if len(da)==1:return [dv() for _ in range(da[0])]
    else:return [makeArr(dv,da[1:]) for _ in range(da[0])]
 
def queryInteractive(x,y):
    print('? {} {}'.format(x,y))
    sys.stdout.flush()
    return int(input())
 
def answerInteractive(i1,j1,i2,j2):
    print('! {} {} {} {}'.format(i1,j1,i2,j2))
    sys.stdout.flush()
 
inf=float('inf')
# MOD=10**9+7
# MOD=998244353

from math import gcd,floor,ceil
import math
# from math import floor,ceil # for Python2
 
for _abc in range(1):
    main()