#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, m, k;
  cin >> n >> m >> k;
  vector<pair<pair<long, long>, long> > edges(m);
  for (long p = 0; p < m; p++) {
    long x, y, d;
    cin >> x >> y >> d;
    edges[p] = make_pair(make_pair(x, y), d);
  }
  set<long> storage;
  for (long p = 0; p < k; p++) {
    long x;
    cin >> x;
    storage.insert(x);
  }
  long minDist = -1;
  for (long p = 0; p < edges.size(); p++) {
    long x = edges[p].first.first;
    long y = edges[p].first.second;
    long d = edges[p].second;
    if (storage.count(x) == storage.count(y)) continue;
    if (minDist < 0 || d < minDist) {
      minDist = d;
    }
  }
  cout << minDist << endl;
  return 0;
}
