#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, m, k, i;
  cin >> n >> m >> k;
  vector<vector<int> > road(m, vector<int>(3));
  for (i = 0; i < m; i++) {
    cin >> road[i][0] >> road[i][1] >> road[i][2];
  }
  vector<bool> storage(n + 1);
  while (k--) {
    cin >> i;
    storage[i] = 1;
  }
  int Min = INT_MAX;
  for (i = 0; i < m; i++) {
    if (storage[road[i][0]] + storage[road[i][1]] == 1)
      Min = min(Min, road[i][2]);
  }
  if (Min == INT_MAX) Min = -1;
  cout << Min << endl;
  return 0;
}
