#include #define rep(i,n) for (int i=0; i < (n); i++) using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); int N,M; cin>>N>>M; vector A(N+1,0); vector light(N+1,0); rep(i,N){ int a; cin>>a; A[i+1] = -a; } vector> load(N+1,vector()); rep(i,M){ int u,v; cin>>u>>v; load[u].push_back(v); load[v].push_back(u); } priority_queue> que; //強さ・番号 int K; cin>>K; rep(i,K){ int B; cin>>B; light[B]=1; que.push(make_pair(A[B],B)); } vector ans; while(que.size()){ auto x = que.top(); que.pop(); int a = x.first, b=x.second; if(light[b]==0) continue; light[b]=0; // cerr << a << " " << b <