#include <bits/stdc++.h>
using namespace std;
set<pair<int, pair<int, int> > > d;
bool a[100000];
int main() {
  int n, m, k, u, v, l, t;
  cin >> n >> m >> k;
  for (int i = 0; i < m; ++i) {
    cin >> u >> v >> l;
    if (u > v) {
      t = u;
      u = v;
      v = t;
    }
    d.insert(make_pair(l, make_pair(u, v)));
  }
  for (int i = 0; i < k; ++i) {
    cin >> t;
    a[t] = true;
  }
  for (set<pair<int, pair<int, int> > >::iterator it = d.begin(); it != d.end();
       ++it) {
    if (a[it->second.second] && !a[it->second.first] ||
        !a[it->second.second] && a[it->second.first]) {
      cout << it->first << endl;
      return 0;
    }
  }
  cout << "-1\n";
  return 0;
}
