#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  map<pair<int, int>, long long> mp;
  cin >> n >> m >> k;
  map<int, vector<int> > adj;
  for (int i = (0); i < (m); i++) {
    int a, b;
    long long l;
    cin >> a >> b;
    cin >> l;
    int c = min(a, b);
    int d = max(a, b);
    pair<int, int> x = pair<int, int>(c, d);
    if (mp.find(x) != mp.end())
      mp[x] = min(mp[x], l);
    else
      mp[x] = l;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  long long mn = 1e10;
  set<int> baks;
  for (int i = (0); i < (k); i++) {
    int a;
    cin >> a;
    baks.insert(a);
  }
  if (k == 0 || k == n) {
    cout << -1 << "\n";
    return 0;
  }
  for (__typeof((baks).begin()) it = (baks).begin(); it != (baks).end(); it++) {
    int x = *it;
    for (int j = (0); j < (adj[x].size()); j++) {
      int y = adj[x][j];
      if (baks.find(y) == baks.end()) {
        pair<int, int> p = pair<int, int>(min(x, y), max(x, y));
        mn = min(mn, mp[p]);
      }
    }
  }
  if (mn != 1e10) {
    cout << mn << "\n";
  } else {
    cout << -1 << "\n";
  }
  return 0;
}
