#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long int n, m, k;
  cin >> n >> m >> k;
  set<long long int> isFlour;
  vector<pair<long long int, long long int> > gr[n + 1];
  for (long long int i = 0; i < m; i++) {
    long long int u, v, we;
    cin >> u >> v >> we;
    gr[u].push_back(make_pair(v, we));
    gr[v].push_back(make_pair(u, we));
  }
  long long int mini = 100000000000;
  for (long long int i = 0; i < k; i++) {
    long long int x;
    cin >> x;
    isFlour.insert(x);
  }
  for (auto x : isFlour) {
    for (auto it : gr[x]) {
      long long int node = it.first;
      if (isFlour.count(node)) {
        continue;
      } else {
        mini = min(mini, it.second);
      }
    }
  }
  if (mini != 100000000000) {
    cout << mini << "\n";
  } else {
    cout << "-1"
         << "\n";
  }
  return 0;
}
