n,m=map(int,input().split()) a=list(map(int,input().split())) g=[[] for _ in range(n)] for i in range(m): u,v=map(int,input().split()) g[u-1].append(v-1) g[v-1].append(u-1) k=int(input()) b=list(map(int,input().split())) arr=[0]*n for i in range(n): arr[i]=(i,a[i]) arr=sorted(arr,key=lambda x: x[1]) on=[0]*n for j in range(k): on[b[j]-1]=1 ans=[] for i in range(n): p=arr[i][0] if on[p]==0: continue for c in g[p]: if on[c]: if a[c]>a[p]: on[c]=0 ans.append(p+1) print(len(ans)) print(*ans,sep='\n')