#include #include #include using namespace atcoder; using mint = modint998244353; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000001 int main(){ int N,M; cin>>N>>M; vector A(N); vector> P; rep(i,N){ cin>>A[i]; P.emplace_back(A[i],i); } vector> E(N); rep(i,M){ int u,v; cin>>u>>v; u--;v--; E[u].push_back(v); E[v].push_back(u); } vector b(N,0); int K; cin>>K; rep(i,K){ int B; cin>>B; b[B-1] = 1; } sort(P.begin(),P.end()); vector ans; rep(i,P.size()){ int ind = P[i].second; if(b[ind]){ ans.push_back(ind+1); b[ind] ^= 1; rep(j,E[ind].size()){ if(A[ind] < A[E[ind][j]]){ b[E[ind][j]] ^= 1; } } } } cout<