Princess in Danger (AOJ 2021) by letter
Contest: 3575    RunID: 2376029    Status: Time Limit Exceeded    Date: Sat Jun 17 14:19:39 JST 2017


#include<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
 
typedef long long ll;
typedef pair<int, int> ii;

#define DEBUG false

int main() {
	
	ll n, m, l, k, a, h;
	//a:首都
	//h:目的地
	while(cin >> n >> m >> l >> k >> a >> h){
		if(n ==0 && m == 0&&l==0&&k==0&&a==0&&h==0) break;
	
		vector<bool> cold(n);
		vector<vector<ii>> g(n);
		rep(i, l){
			int tmp;
			cin >> tmp;
			cold[tmp] = true;
		}
		rep(i, k) {
			ll x, y, k;
			cin >> x >> y >> k;
			g[x].push_back(make_pair(y, k));
			g[y].push_back(make_pair(x, k));
		}
		
		/*
		vector<bool> used(n);
		priority_queue<ii> qu;//cost, now
		qu.push(make_pair(0, a));
		used[a] = true;
		while(!qu.empty()){
			ii tmp = qu.top();
			qu.pop();
			int pos = tmp.second;
			if(pos == k){
				cout << tmp.first
			}
			rep(i, g[tmp.second].size()){
				
			}
			
		}
		*/
		
		vector<vector<ll>> dp(n, vector<ll>(m+1, IINF));
		priority_queue<pair<ll, pair<ll, ll>>> qu;//cost, now, rest
		qu.push(make_pair(0, make_pair(a, m)));
		while(!qu.empty()){
			auto tmp = qu.top();
			qu.pop();
			ll cost = tmp.first;
			ll pos = tmp.second.first;
			ll rest = tmp.second.second;
			if(dp[pos][rest] < cost) continue;
			dp[pos][rest] = cost;
			
			if(cold[pos] && rest < m) qu.push(make_pair(cost+1, make_pair(pos, rest+1)));
			rep(i, g[pos].size()){
				ll weight = g[pos][i].second;
				if(DEBUG) cout << pos << "\t" << g[pos][i].first << "\t" << rest << "\t" << weight << endl;
				if(rest - weight >= 0) qu.push(make_pair(cost + weight, make_pair(g[pos][i].first, rest-weight)));
			}
			
		}
		
		bool flag = false;
		ll ans = LLINF;
		rep(i, m+1) if(dp[h][i] != IINF){
			flag = true;
			ans = min(ans, dp[h][i]);
		}
		
		if(flag) cout << ans << endl;
		else cout << "Help!" << endl;
		
		if(DEBUG){
			rep(i, n){
				rep(j, m+1) cout << dp[i][j]  << "\t";
				cout << endl;
			}
		}
		
	}
	
	
	return 0;
}