#include <bits/stdc++.h>
using namespace std;
int const N = 101000;
int const M = 1001000;
struct edges {
  int u, w, next;
} e[M];
int p[N], idx;
void addedge(int u, int v, int w) {
  e[idx].u = v, e[idx].w = w, e[idx].next = p[u], p[u] = idx++;
}
void init() {
  idx = 0;
  memset(p, (0xff), sizeof p);
}
bool vis[N];
int main() {
  int n, m, k;
  init();
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < (m); ++i) {
    int x, y, z;
    scanf("%d%d%d", &x, &y, &z);
    addedge(x, y, z);
    addedge(y, x, z);
  }
  for (int i = 0; i < (k); ++i) {
    int x;
    scanf("%d", &x);
    vis[x] = 1;
  }
  int ans = 0x3f3f3f3f;
  for (int i = 1; i <= n; ++i)
    if (vis[i]) {
      for (int j = p[i]; ~j; j = e[j].next) {
        int v = e[j].u;
        if (!vis[v]) {
          ans = min(ans, e[j].w);
        }
      }
    }
  if (ans == 0x3f3f3f3f) ans = -1;
  printf("%d\n", ans);
  return 0;
}
