n, m = map(int, input().split()) A = list(map(int, input().split())) C = [(a, i) for i, a in enumerate(A)] C.sort() edges = [[] for _ in range(n)] for _ in range(m): u, v = map(int, input().split()) u -= 1 v -= 1 edges[u].append(v) edges[v].append(u) k = int(input()) B = list(map(int, input().split())) on = [True] * n for b in B: on[b - 1] = False ans = [] for a, i in C: if on[i]: continue ans.append(i + 1) on[i] ^= True for j in edges[i]: if a < A[j]: on[j] ^= True assert all(o for o in on) print(len(ans)) print(*ans, sep="\n")