#include <bits/stdc++.h>
using namespace std;
long long s = 1000000100, x, c[100010];
int n, m, k, a[100010], b[100010];
bool v[100010];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < m; i++) scanf("%d%d%lld", &a[i], &b[i], &c[i]);
  for (int i = 0; i < k; i++) {
    scanf("%d", &x);
    v[x] = true;
  }
  for (int i = 0; i < m; i++) {
    if (v[a[i]] && !v[b[i]] || v[b[i]] && !v[a[i]]) {
      s = min(s, c[i]);
    }
  }
  if (s == 1000000100)
    printf("-1\n");
  else
    printf("%lld\n", s);
  return 0;
}
