#include #include #include #include #include #include #include using namespace std; using ll = long long; using P = pair; constexpr ll MOD = 998244353; int main(){ int n, m, k, p; cin >> n >> k >> m >> p; vector> G(n); for(int i = 0; i < m; i++){ int u, v; cin >> u >> v; u--; v--; G[u].emplace_back(v); G[v].emplace_back(u); } vector s(n); for(auto &it: s) cin >> it; vector x(k); for(auto &it: x){ cin >> it; it--; } vector>> events(2); vector states(n, 0); vector cnt(n, 0); priority_queue, greater> days; for(const auto &it: x){ events[1][s[it]].emplace_back(it); days.emplace(s[it]); events[0][p].emplace_back(it); days.emplace(p); cnt[it]++; states[it] = 1; } set past; for(int day = 0; day < 150000000; day++){ // const int day = days.top(); days.pop(); if(past.count(day) == 1) continue; past.emplace(day); if(events[0].count(day) == 1){ for(const auto &it: events[0][day]){ if(states[it] == 3) continue; states[it] = 2; } } if(events[1].count(day) == 1){ for(const auto &it: events[1][day]){ if(states[it] == 3) continue; for(const auto &nex: G[it]){ if(2 <= states[nex]) continue; cnt[nex]++; if(cnt[nex] == 1){ events[1][day+s[nex]].emplace_back(nex); days.emplace(day+s[nex]); events[0][day+p].emplace_back(nex); days.emplace(day+p); states[nex] = 1; }else{ states[nex] = 3; } } } } } int ans = 0; for(int i = 0; i < n; i++){ if(states[i] == 3) ans++; } cout << ans << endl; return 0; }