#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int mark[n + 1];
  memset(mark, -1, sizeof mark);
  map<pair<int, int>, vector<int> > mp;
  for (int i = 0; i < m; ++i) {
    int u, v, l;
    cin >> u >> v >> l;
    mp[{u, v}].push_back(l);
  }
  if (k) {
    for (int i = 0; i < k; ++i) {
      int a;
      cin >> a;
      mark[a] = 1;
    }
  }
  int mi = (int)1e9 + 1;
  for (auto it : mp) {
    int u = it.first.first;
    int v = it.first.second;
    if (mark[u] * mark[v] < 0) {
      for (int i = 0; i < (int)it.second.size(); ++i)
        mi = min(mi, it.second[i]);
    }
  }
  if (mi == (int)1e9 + 1) mi = -1;
  cout << mi << endl;
  return 0;
}
