local n, m = io.read("*n", "*n") local a = {} local aidx = {} for i = 1, n do a[i] = io.read("*n") aidx[i] = i end table.sort(aidx, function(x, y) return a[x] < a[y] end) local edge = {} for i = 1, n do edge[i] = {} end for i = 1, m do local x, y = io.read("*n", "*n") if a[x] < a[y] then table.insert(edge[x], y) elseif a[y] < a[x] then table.insert(edge[y], x) end end local flag = {} for i = 1, n do flag[i] = false end local k = io.read("*n") for i = 1, k do local z = io.read("*n") flag[z] = true end local ret = {} for ia = 1, n do local i = aidx[ia] if flag[i] then table.insert(ret, i) for j = 1, #edge[i] do local dst = edge[i][j] flag[dst] = not flag[dst] end end end print(#ret) print(table.concat(ret, "\n"))