#include <bits/stdc++.h>
using namespace std;
int a[100009], b[100009], w[100009], ans, temp[100009];
long long int mi;
int main() {
  int n, m, k, i, x;
  scanf("%d %d %d", &n, &m, &k);
  memset(temp, 0, sizeof(temp));
  for (i = 0; i < m; i++) {
    scanf("%d %d %d", &a[i], &b[i], &w[i]);
  }
  for (i = 0; i < k; i++) {
    scanf("%d", &x);
    temp[x] = 1;
  }
  mi = 1000000007;
  for (i = 0; i < m; i++) {
    if ((temp[a[i]] == 1) && (temp[b[i]] != 1)) {
      if (w[i] < mi) {
        mi = w[i];
      }
    }
    if ((temp[a[i]] != 1) && (temp[b[i]] == 1)) {
      if (w[i] < mi) {
        mi = w[i];
      }
    }
  }
  if (mi < 1000000007)
    cout << mi << endl;
  else
    cout << "-1" << endl;
  return 0;
}
