#include <bits/stdc++.h>
using namespace std;
long long n, m, i, j, u, v, l, k, used[100001], a[100001], w, ans = -1;
vector<pair<long long, long long> > g[100001];
int main() {
  cin >> n >> m >> k;
  for (i = 0; i < m; i++) {
    scanf("%d%d%d", &u, &v, &l);
    g[u].push_back(make_pair(v, l));
    g[v].push_back(make_pair(u, l));
  }
  for (i = 0; i < k; i++) {
    scanf("%d", &a[i]);
    used[a[i]] = 1;
  }
  for (i = 0; i < k; i++) {
    for (j = 0; j < g[a[i]].size(); j++) {
      w = g[a[i]][j].second;
      v = g[a[i]][j].first;
      if (used[v] == 0)
        if (ans == -1)
          ans = w;
        else
          ans = min(ans, w);
    }
  }
  cout << ans << endl;
  return 0;
}
