#include <bits/stdc++.h>
using namespace std;
void fast(int &x) {
  register int c = getchar();
  x = 0;
  int neg = 0;
  for (; ((c < 48 || c > 57) && c != '-'); c = getchar())
    ;
  if (c == '-') {
    neg = 1;
    c = getchar();
  }
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
  if (neg) x = -x;
}
int A[100005], B[100005], C[100005], KK[100005];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int ans = INT_MAX;
  for (int i = 0; i < m; i++) {
    cin >> A[i] >> B[i] >> C[i];
  }
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    KK[x] = 1;
  }
  for (int i = 0; i < m; i++) {
    if ((KK[A[i]] == 1 || KK[B[i]] == 1) && KK[A[i]] + KK[B[i]] != 2) {
      ans = min(ans, C[i]);
    }
  }
  if (ans == INT_MAX)
    cout << "-1" << endl;
  else
    cout << ans << endl;
  return 0;
}
