N,M=map(int,input().split()) A=[-1]+list(map(int,input().split())) AS= [[0] * 2 for i in range(N+1)] for i,a in enumerate(A): AS[i][0]=i AS[i][1]=a AS = sorted(AS, key=lambda x: x[1]) L = [] for i in range(N+1): L.append([]) for i in range(M): v,u = map(int,input().split()) L[v].append(u) L[u].append(v) K = int(input()) B=list(map(int,input().split())) LAMP=[False]*(N+1) for b in B: LAMP[b]=True ANS = [] for i,a in AS: if LAMP[i]: ANS.append(i) for l in L[i]: if A[i]