#include using namespace std; #define int long long signed main() { int n,m,c,s,t; cin >> n >> m >> c >> s >> t; vector>> a(n); while(m--) { int x,y,w; cin >> x >> y >> w; x--,y--; a[x].push_back({y,w}); a[y].push_back({x,w}); } vector v(n,1e18),w(n,1e18); priority_queue,vector>,greater>> q; v[0] = 0; w[n-1] = 0; q.push({0,0}); while(q.size() > 0) { int x,e; tie(e,x) = q.top(); q.pop(); if(v[x] != e) continue; int l = a[x].size(); for(int i = 0; i < l; i++) { int y,f; tie(y,f) = a[x][i]; if(v[y] > v[x]+f) { v[y] = v[x]+f; q.push({v[y],y}); } } } q.push({0,n-1}); while(q.size() > 0) { int x,e; tie(e,x) = q.top(); q.pop(); if(w[x] != e) continue; int l = a[x].size(); for(int i = 0; i < l; i++) { int y,f; tie(y,f) = a[x][i]; if(w[y] > w[x]+f) { w[y] = w[x]+f; q.push({w[y],y}); } } } int ans = 1e18; while(c--) { int x; cin >> x; x--; if(v[x] < s+t) ans = min(ans,max(s,v[x])+1+w[x]); } if(ans >= 1e16) cout << -1 << endl; else cout << ans << endl; }