#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long long inf = 1e18;
struct node {
  int to;
  long long cost;
  bool operator<(const node &a) const { return cost > a.cost; }
};
vector<node> edge[100005];
int vis[100005];
int deli[100005];
long long dis[100005];
int n;
void dijkstra(int st) {
  for (int i = 1; i <= n; i++) {
    vis[i] = 0;
    dis[i] = inf;
  }
  vis[st] = 0;
  dis[st] = 0;
  priority_queue<node> q;
  node u{};
  u.to = st;
  u.cost = 0;
  q.push(u);
  while (!q.empty()) {
    u = q.top();
    q.pop();
    if (vis[u.to]) continue;
    vis[u.to] = 1;
    for (int i = 0; i < edge[u.to].size(); i++) {
      node v = edge[u.to][i];
      if (v.cost + dis[u.to] < dis[v.to]) {
        dis[v.to] = dis[u.to] + v.cost;
        q.push({v.to, dis[v.to]});
      }
    }
  }
}
int main() {
  int m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < m; i++) {
    int u, v, l;
    scanf("%d%d%d", &u, &v, &l);
    edge[u].push_back({v, l});
    edge[v].push_back({u, l});
  }
  memset(deli, 0, sizeof(deli));
  for (int i = 0; i < k; i++) {
    int tmp;
    scanf("%d", &tmp);
    deli[tmp] = 1;
    edge[0].push_back({tmp, 0});
  }
  dijkstra(0);
  long long ans = inf;
  for (int i = 1; i <= n; i++) {
    if (!deli[i]) {
      ans = min(ans, dis[i]);
    }
  }
  if (ans != inf)
    cout << ans;
  else
    cout << -1;
}
