#include <bits/stdc++.h>
using namespace std;
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  c_p_c();
  long long n, m, k;
  cin >> n >> m >> k;
  long long arr[k];
  map<long long, vector<pair<long long, long long> > > mpp;
  for (long long i = 0; i < m; i++) {
    long long a, b, c;
    cin >> a >> b >> c;
    mpp[a].push_back(make_pair(b, c));
    mpp[b].push_back(make_pair(a, c));
  }
  map<long long, long long> mpp2;
  for (long long i = 0; i < k; i++) {
    cin >> arr[i];
    mpp2[arr[i]] = i;
  }
  long long maxValue = 1e18;
  for (long long i = 0; i < k; i++) {
    vector<pair<long long, long long> > vpp = mpp[arr[i]];
    for (long long j = 0; j < vpp.size(); j++) {
      if (mpp2.find(vpp[j].first) == mpp2.end()) {
        maxValue = min(maxValue, vpp[j].second);
      }
    }
  }
  if (maxValue == 1e18)
    cout << -1;
  else
    cout << maxValue;
}
