#include <bits/stdc++.h>
using namespace std;
long long head[100005], cnt, n, m, k, ans, x[100005];
bool y[100005];
struct ed {
  long long next, to, val;
} e[100005 * 4];
inline void ins(int u, int v, int w) {
  e[++cnt].to = v;
  e[cnt].val = w;
  e[cnt].next = head[u];
  head[u] = cnt;
}
int main() {
  scanf("%I64d%I64d%I64d", &n, &m, &k);
  int a, b, c, d;
  if (k == 0) {
    printf("-1\n");
    return 0;
  }
  for (int i = 1; i <= m; i++) {
    scanf("%I64d%I64d%I64d", &a, &b, &c);
    ins(a, b, c);
    ins(b, a, c);
  }
  long long mi = 10000000000;
  for (int i = 1; i <= k; i++) scanf("%I64d", &x[i]), y[x[i]] = 1;
  for (int i = 1; i <= k; i++) {
    for (int j = head[x[i]]; j; j = e[j].next) {
      if (!y[e[j].to]) mi = min(mi, e[j].val);
    }
  }
  if (mi == 10000000000) {
    printf("-1\n");
    return 0;
  }
  printf("%I64d\n", mi);
  return 0;
}
