#include<bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
const int N = 1e5+5;
int n,m,k,q,hd[N+3],sz[N+3];
vector<char> ans;
vector<pair<ll,ll>>vec[N+3];
vector<int>np;
ll val[N+3];
int fh(int x){
if(x==hd[x])return x;
return hd[x]=fh(hd[x]);
}
void uh(int x,int y){
x=fh(x);
y=fh(y);
if(x==y)return;
if(sz[x]>=sz[y]){
sz[x]+=sz[y];
sz[y]=0;
hd[y]=x;
}
else{
sz[y]+=sz[x];
sz[x]=0;
hd[x]=y;
}
}
ll sol(int s,int e){
vector<ll>dp(n+2,-1e18);
dp[s]=val[s];
priority_queue<tuple<ll,ll>,vector<tuple<ll,ll>>,greater<tuple<ll,ll>>>pq;
pq.push({val[s],s});
while(!pq.empty()){
auto[cw,cur]=pq.top();
pq.pop();
if(dp[cur]>cw)continue;
for(auto [nx,nw]:vec[cur]){
ll tw=min(cw,val[nx]);
if(dp[nx]<tw){
dp[nx]=tw;
pq.push({tw,nx});
}
}
}
return dp[e];
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin>>n>>m;
for(int i=1;i<=m;i++){
int x,y,w;cin>>x>>y>>w;
vec[x].emplace_back(y,w);
vec[y].emplace_back(x,w);
}
for(int i=1;i<=n;i++){
val[i]=1e18;
}
priority_queue<tuple<ll,ll>,vector<tuple<ll,ll>>,greater<tuple<ll,ll>>>pq;
cin>>k;
for(int i=1;i<=k;i++){
int x;
cin>>x;
np.emplace_back(x);
val[x]=0;
pq.push({0,x});
}
while(!pq.empty()){
auto[cw,cur]=pq.top();
pq.pop();
if(val[cur]<cw)continue;
for(auto [nx,nw]:vec[cur]){
ll tw=cw+nw;
if(val[nx]>tw){
val[nx]=tw;
pq.push({tw,nx});
}
}
}
cin>>q;
int s,e;cin>>s>>e;
vector<pair<ll,int>>dt;
for(int i=1;i<=n;i++){
dt.emplace_back(val[i],i);
}
sort(dt.rbegin(),dt.rend());
for(int i=1;i<=n;i++){
hd[i]=i;
sz[i]=1;
}
for(auto[vv,cn]:dt){
for(auto [nx,_]:vec[cn]){
if(val[nx]>=vv){
uh(nx,cn);
if(fh(s)==fh(e)){
cout<<vv;
return 0;
}
}
}
}
return 0;
}
/*
9 12
1 9 4
1 2 5
2 3 7
2 4 3
4 3 6
3 6 4
8 7 10
6 7 5
5 8 1
9 5 7
5 4 12
6 8 2
2
4 7
5
1 6
5 3
4 8
5 8
1 5
*/