#include using namespace std; using ll = long long; const int INF = 1e9 + 10; const ll INFL = 4e18; int main() { int N, M, L; ll S, E; cin >> N >> M >> L >> S >> E; vector>> G(N); for (int i = 0; i < M; i++) { int a, b; ll t; cin >> a >> b >> t; a--; b--; G[a].push_back({b, t}); G[b].push_back({a, t}); } vector T(N, false); for (int i = 0; i < L; i++) { int t; cin >> t; t--; T[t] = true; } priority_queue, vector>, greater<>> pq; pq.push({0, 0}); vector D(2 * N, INFL); D[0] = 0; while (!pq.empty()) { auto [nowd, now] = pq.top(); pq.pop(); bool done = now >= N; int nowv = now % N; if (D[now] < nowd) { continue; } for (auto [to, cost] : G[nowv]) { int nxt = to; if (done) { nxt += N; } if (D[nxt] > D[now] + cost) { D[nxt] = D[now] + cost; pq.push({D[nxt], nxt}); } } if (T[nowv] && !done && nowd < S + E) { int nxt = now + N; ll nxtt = max(S + 1, nowd + 1); if (D[nxt] > nxtt) { D[nxt] = nxtt; pq.push({D[nxt], nxt}); } } } ll ans = D[N * 2 - 1]; if (ans == INFL) { ans = -1; } cout << ans << endl; }