#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n, m, k, min = 1000000001, dis, a, b, len;
  cin >> n >> m >> k;
  int mark[1000000] = {0};
  vector<pair<int, int> > v[n + 1];
  for (int i = 1; i <= m; i++) {
    cin >> a >> b >> len;
    v[a].push_back(make_pair(b, len));
    v[b].push_back(make_pair(a, len));
  }
  for (int i = 0; i < k; i++) {
    cin >> a;
    mark[a] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (mark[i] == 0)
      for (int j = 0; j < (int)v[i].size(); j++) {
        if (mark[v[i][j].first] == 1) {
          dis = v[i][j].second;
          if (dis < min) min = dis;
        }
      }
  }
  if (min == 1000000001) min = -1;
  cout << min << endl;
  return 0;
}
