#include #define rep(i,n) for(int i = 0; i < (int)(n); i++) #define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--) #define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++) #define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--) #define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++) #define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++) #define ALL(x) x.begin(), x.end() using ll = long long; using namespace std; int main() { int n, m; cin >> n >> m; vector> a(n); vector aa(n); rep(i, n) { int in; cin >> in; a.at(i) = {in, i}; aa.at(i) = in; } vector> gr(n, vector()); rep(i, m){ int a, b; cin >> a >> b; a--; b--; gr.at(a).push_back(b); gr.at(b).push_back(a); } int k; cin >> k; vector co(n, 0), stk(n, 0); rep(i, k) { int in; cin >> in; in--; co.at(in)++; } sort(ALL(a)); vector ans; for(auto [c, now] : a) { co.at(now) += stk.at(now); int add = stk.at(now); if(co.at(now) % 2 != 0) { add++; ans.push_back(now); } for(auto nx : gr.at(now)) { if(aa.at(nx) < c) continue; stk.at(nx) += add; } } cout << ans.size() << endl; for(auto i : ans) { cout << i+1 << endl; } return 0; }