#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<pair<long, long> > v;
  long long arr[100001], prr[100001], n, m, k, count = 0, min = INT_MAX, i, j,
                                               a, b;
  cin >> n >> m >> k;
  for (i = 0; i < m; ++i) {
    cin >> a >> b >> arr[i];
    v.push_back(make_pair(a, b));
  }
  for (i = 0; i < k; ++i) cin >> prr[i];
  sort(prr, prr + k);
  for (i = 0; i < m; ++i) {
    count = 0;
    if (binary_search(prr, prr + k, v[i].first) ^
        binary_search(prr, prr + k, v[i].second)) {
      if (min > arr[i]) min = arr[i];
    }
  }
  if (min != INT_MAX)
    cout << min;
  else
    cout << -1;
}
