class Peek: def __init__(self, i, A): self.i = i self.A = A self.V = [] self.B = False def __str__(self): return str(self.i) + ":" + str(self.A) + "," + str(self.B) + "," + str(self.V) N, M = map(int, input().split()) A = [] for i, a in enumerate(list(map(int, input().split()))): A.append(Peek(i, a)) for _ in range(M): u, v = map(int, input().split()) A[u-1].V.append(v-1) A[v-1].V.append(u-1) K = int(input()) for b in list(map(int, input().split())): A[b-1].B = True S = sorted(A, key=lambda x: x.A) op = [] for p in S: if p.B : p.B = False op.append(p.i+1) for i in p.V: if p.A < A[i].A: A[i].B = not A[i].B if any([i.B for i in A]): print(-1) else: print(len(op)) for p in op: print(p)