#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n, m, k;
  int u, v, l, a_k;
  cin >> n >> m >> k;
  set<int> storages;
  vector<list<pair<int, int> > > edges(n + 1);
  for (int i = 0; i < m; ++i) {
    cin >> u >> v >> l;
    edges[u].push_back(pair<int, int>(v, l));
    edges[v].push_back(pair<int, int>(u, l));
  }
  if (k > 0) {
    int minPath = numeric_limits<int>::max();
    for (int i = 0; i < k; ++i) {
      cin >> a_k;
      storages.insert(a_k);
    }
    for (set<int>::iterator it = storages.begin(); it != storages.end(); ++it) {
      for (list<pair<int, int> >::iterator i = edges[*it].begin();
           i != edges[*it].end(); ++i) {
        if (storages.find(i->first) == storages.end() && i->second < minPath) {
          minPath = i->second;
        }
      }
    }
    if (minPath == numeric_limits<int>::max()) {
      minPath = -1;
    }
    cout << minPath << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}
