/*
题意:给你n个城市,m条无向边,k个有卖面粉的城市,你要在没有卖面粉的地方建一家面包店,每条无向边有一个权值
求从面包店到一个卖面粉的地方花费的最小权值是多少。
类型:图论
分析:直接搜索每个卖面粉的点所连接的城市,看是否可以建面包店(没卖面粉),如果是,更新最小值即可
*/
#include<cstdio>
#include<iostream>
#include<queue>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
int n,m,k,tot;
struct Edge{
int u,v,w;
int next;
Edge(){}
Edge(int u,int v,int w):u(u),v(v),w(w){}
};
Edge edge[1000005];
int head[1000005];
void init(){
tot=0;
memset(head,-1,sizeof(head));
}
void add(int u,int v,int w){
edge[tot]=Edge(u,v,w);
edge[tot].next=head[u];
head[u]=tot++;
}
int f[1000005];
int kk[1000005];
int main()
{
init();
cin>>n>>m>>k;
int a,b,c;
for(int i=0;i<m;i++){
scanf("%d%d%d",&a,&b,&c);
add(a,b,c);
add(b,a,c);
}
int kkk;
for(int i=0;i<k;i++){
scanf("%d",&kkk);
f[kkk]=1;
kk[i]=kkk;
}
int Max = 0x7fffffff;
//cout<<Max<<endl;
for(int i=0;i<k;i++){
for(int j=head[kk[i]];j!=-1;j=edge[j].next){
int to=edge[j].v;
if(f[to]==0){
if(edge[j].w<Max)
Max=edge[j].w;
}
}
}
if(Max==0x7fffffff)cout<<"-1"<<endl;
else cout<<Max<<endl;
return 0;
}