#include <bits/stdc++.h>
using namespace std;
long long a[100000];
void solve() {
  long long n, m, k;
  cin >> n >> m >> k;
  vector<pair<long long, pair<long long, long long> > > v1;
  long long u, v, l;
  long long x;
  for (int i = 0; i < m; i++) {
    cin >> u >> v >> l;
    v1.push_back(make_pair(l, make_pair(u, v)));
  }
  sort(v1.begin(), v1.end());
  for (int i = 1; i <= k; i++) {
    cin >> x;
    a[x] = 1;
  }
  long long z = 0;
  for (int i = 0; i < m; i++) {
    long long p = v1[i].second.first;
    long long q = v1[i].second.second;
    if ((a[p] == 0 && a[q] == 1) || (a[p] == 1 && a[q] == 0)) {
      z = v1[i].first;
      break;
    }
  }
  if (k && z) {
    cout << z << endl;
  } else {
    cout << "-1" << endl;
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
  return 0;
}
