#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n = 0, m = 0, k = 0;
  cin >> n >> m >> k;
  vector<map<int, int> > vec(n + 1);
  for (int i = 0; i < m; i++) {
    int a = 0, b = 0, c = 0;
    cin >> a >> b >> c;
    if (vec[a].count(b)) {
      vec[a][b] = min(vec[a][b], c);
    } else
      vec[a][b] = c;
    if (vec[b].count(a)) {
      vec[b][a] = min(vec[b][a], c);
    } else
      vec[b][a] = c;
  }
  if (k == 0) {
    cout << -1 << endl;
    return 0;
  }
  bool arr[100001] = {false};
  vector<int> bak(k + 1);
  for (int i = 0; i < k; i++) {
    cin >> bak[i];
    arr[bak[i]] = true;
  }
  if (k == n) {
    cout << -1 << endl;
    return 0;
  }
  int _min = 1000000001;
  for (int j = 0; j < k; j++) {
    map<int, int>::iterator itr = vec[bak[j]].begin();
    for (; itr != vec[bak[j]].end(); itr++) {
      if (arr[itr->first] == false && itr->second < _min) _min = itr->second;
    }
  }
  if (_min == 1000000001)
    cout << -1 << endl;
  else
    cout << _min << endl;
  return 0;
}
