#include <bits/stdc++.h>
using namespace std;
inline int _read() {
  int x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x;
}
const int maxn = 4 * 1e5;
struct edge {
  int v, val;
  int nxt;
} e[maxn];
int head[maxn], _t = 0;
inline void addedge(int u, int v, int val) {
  e[++_t].v = v, e[_t].val = val, e[_t].nxt = head[u], head[u] = _t;
}
int a[maxn], vis[maxn];
int main() {
  int N = _read(), M = _read(), k = _read();
  memset(head, 0xff, sizeof head);
  for (int i = (1); i <= (M); i++) {
    int u = _read(), v = _read(), w = _read();
    addedge(u, v, w);
    addedge(v, u, w);
  }
  int ans = 2 * 1e9;
  for (int i = (1); i <= (k); i++) a[i] = _read(), vis[a[i]] = true;
  for (int i = (1); i <= (k); i++) {
    for (int j = head[a[i]]; ~j; j = e[j].nxt)
      if (vis[e[j].v] == 0) ans = min(ans, e[j].val);
  }
  ans = ans == 2 * 1e9 ? -1 : ans;
  cout << ans << endl;
  return 0;
}
