#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > v[100005];
long long cnt_fl[100005], ans = 100000000000005;
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  while (m--) {
    long long a, b, w;
    cin >> a >> b >> w;
    v[a].push_back({b, w});
    v[b].push_back({a, w});
  }
  for (long long i = 1; i <= k; i++) {
    long long z;
    cin >> z;
    cnt_fl[z]++;
  }
  for (long long i = 1; i <= n; i++) {
    if (cnt_fl[i]) continue;
    for (long long k = 0; k < v[i].size(); k++) {
      pair<long long, long long> p = v[i][k];
      if (cnt_fl[p.first]) {
        ans = min(ans, p.second);
      }
    }
  }
  if (ans == 100000000000005) {
    cout << -1;
    return 0;
  }
  cout << ans << endl;
}
