n,m=map(int,input().split()) a=[-1]+list(map(int,input().split())) root=[[] for i in range(n+1)] rootr=[[] for i in range(n+1)] import sys sys.setrecursionlimit(10**9) for i in range(m): v,u=map(int,input().split()) if a[v]>a[u]: root[u].append(v) rootr[v].append(u) elif a[u]>a[v]: root[v].append(u) rootr[u].append(v) memo=[-1]*(n+1) light=[0]*(n+1) ans=[] k=int(input()) b=list(map(int,input().split())) for x in b:light[x]=1 def ch(x): light[x]^=1 ans.append(x) for nod in root[x]: light[nod]^=1 def f(x): if memo[x]==1:pass for nod in rootr[x]:f(nod) if light[x]==1:ch(x) memo[x]=1 for i in range(1,n+1):f(i) print(len(ans)) for x in ans:print(x)