#include using namespace std; class Dijkstra { int N; long long S; long long E; const vector>> &G; const vector &T; /* void print(const vector> &A) { for (vector a : A) { cerr << "{" << -a[0] << ", " << -a[1] << "} "; } cerr << endl; } */ public: Dijkstra(int N, long long S, long long E, const vector>> &G, const vector &T) : N(N), S(S), E(E), G(G), T(T) { } long long dijkstra() { vector> dist(N, vector(2, 1LL << 63)); vector> visited(N, vector(2, false)); priority_queue>> Q; dist[0][false] = 0LL; Q.push( { dist[0][false], { 0, false } }); while (!Q.empty()) { pair> q = Q.top(); Q.pop(); if (q.second.first == N - 1 && q.second.second) { //print(dist); return -dist[N - 1][true]; } if (visited[q.second.first][q.second.second]) continue; visited[q.second.first][q.second.second] = true; if (!q.second.second && -dist[q.second.first][q.second.second] >= S + E) continue; if (!q.second.second && T[q.second.first]) { long long d = min(-S - 1, q.first - 1); if (d > dist[q.second.first][true]) { dist[q.second.first][true] = d; Q.push( { d, { q.second.first, true } }); } } for (pair u : G[q.second.first]) { long long d = dist[q.second.first][q.second.second] - u.second; if (d > dist[u.first][q.second.second]) { dist[u.first][q.second.second] = d; Q.push( { d, { u.first, q.second.second } }); } } } //print(dist); return -1; } ~Dijkstra() { } }; int main() { int n, m, l; long long s, e; cin >> n >> m >> l >> s >> e; vector>> G(n); for (int i = 0; i < m; i++) { int a, b; long long t; cin >> a >> b >> t; a -= 1; b -= 1; 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] = true; } Dijkstra dijkstra(n, s, e, G, T); cout << dijkstra.dijkstra() << endl; return 0; }