#include #include using namespace std; using LL = long long; using P = pair; using Graph = vector>; const int INF = 1 << 29; const long long LINF = 1LL << 60; #define all(x) (x).begin(), (x).end() #define rep(i,n) for(int i = 0; i < (n); ++i) templatevoid chmin(T&a, T b){if(a > b) a = b;} templatevoid chmax(T&a, T b){if(a < b) a = b;} int main(){ int N, M; cin >> N >> M; vector> A(N); for(int i = 0; i < N; ++i){ int tmp; cin >> tmp; A[i] = make_pair(tmp, i); } sort(A.begin(), A.end()); Graph G(N); for(int i = 0; i < M; ++i){ int u, v; cin >> u >> v; --u; --v; G[u].push_back(v); G[v].push_back(u); } int K; cin >> K; vector state(N, false); for(int i = 0; i < K; ++i){ int B; cin >> B; --B; state[B] = true; } vector ans_off; for(auto i : A){ int tensu = i.first; int bango = i.second; if(state[bango]==true){ state[bango] = false; ans_off.push_back(bango); for(auto v : G[bango]){ if(tensu