#include <bits/stdc++.h>
struct roads {
  int city;
  int len;
};
bool comp(roads a, roads b) { return a.len < b.len; }
int storage[100001], u[100001], v[100001], l[100001];
roads a[100001];
int main() {
  int b, n, m, k, i;
  for (i = 0; i <= 100000; i++) {
    a[i].city = -1;
    a[i].len = 2147483647;
    storage[i] = -1;
  }
  scanf("%d %d %d", &n, &m, &k);
  for (i = 0; i < m; i++) {
    scanf("%d %d %d", &u[i], &v[i], &l[i]);
  }
  for (i = 0; i < k; i++) {
    scanf("%d", &b);
    storage[b] = 1;
    a[b].city = -1;
    a[b].len = 2147483647;
  }
  for (i = 0; i < m; i++) {
    if (storage[u[i]] != 1) {
      if (a[u[i]].city == -1 ||
          (storage[a[u[i]].city] == 1 && storage[v[i]] == 1)) {
        if (a[u[i]].len > l[i]) {
          a[u[i]].city = v[i];
          a[u[i]].len = l[i];
        }
      } else if (storage[v[i]] == 1) {
        a[u[i]].city = v[i];
        a[u[i]].len = l[i];
      } else if (a[u[i]].city == 1) {
        int x = 0;
      } else {
        if (a[u[i]].len > l[i]) {
          a[u[i]].city = v[i];
          a[u[i]].len = l[i];
        }
      }
    }
    if (storage[v[i]] != 1) {
      if (a[v[i]].city == -1 ||
          (storage[a[v[i]].city] == 1 && storage[u[i]] == 1)) {
        if (a[v[i]].len > l[i]) {
          a[v[i]].city = u[i];
          a[v[i]].len = l[i];
        }
      } else if (storage[u[i]] == 1) {
        a[v[i]].city = u[i];
        a[v[i]].len = l[i];
      } else if (a[v[i]].city == 1) {
        int x = 0;
      } else {
        if (a[v[i]].len > l[i]) {
          a[v[i]].city = u[i];
          a[v[i]].len = l[i];
        }
      }
    }
  }
  std::sort(a, a + (n + 1), comp);
  for (i = 0; i <= n; i++) {
    if (storage[a[i].city] == 1) {
      printf("%d\n", a[i].len);
      break;
    }
  }
  if (i == n + 1) {
    printf("-1\n");
  }
}
