#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, m, k;
  cin >> n >> m >> k;
  vector<pair<pair<long long, long long>, long long> > edges(m);
  for (long long i = 0; i < m; i++) {
    long long x, y, d;
    cin >> x >> y >> d;
    edges[i] = make_pair(make_pair(x, y), d);
  }
  set<long long> storage;
  for (long long i = 0; i < k; i++) {
    long long x;
    cin >> x;
    storage.insert(x);
  }
  long long mini = -1;
  for (long long i = 0; i < edges.size(); i++) {
    long long x = edges[i].first.first;
    long long y = edges[i].first.second;
    long long d = edges[i].second;
    if (storage.count(x) == storage.count(y)) continue;
    if (mini < 0 || d < mini) mini = d;
  }
  cout << mini << "\n";
}
