#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  const int maxm = 100005;
  cin >> n >> m >> k;
  int u[maxm], v[maxm], l[maxm], a[maxm] = {0};
  int b;
  for (int i = 0; i < m; i++) cin >> u[i] >> v[i] >> l[i];
  if (k == 0) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 0; i < k; i++) {
    cin >> b;
    a[b] = 1;
  }
  int mini = 1000000005;
  for (int i = 0; i < m; i++) {
    if (a[u[i]] ^ a[v[i]] == 1 && l[i] < mini) mini = l[i];
  }
  if (mini == 1000000005)
    cout << -1 << endl;
  else
    cout << mini << endl;
  return 0;
}
