#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, k, x, y, z, ans = 1e9;
bool fl[100010], ok;
int u[100010], v[100010], w[100010];
char ch;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (i = 1; i <= m; i++) scanf("%d%d%d", &u[i], &v[i], &w[i]);
  for (i = 1; i <= k; i++) scanf("%d", &x), fl[x] = 1;
  for (i = 1; i <= m; i++)
    if (fl[u[i]] ^ fl[v[i]]) ok = 1, ans = min(ans, w[i]);
  if (ok)
    printf("%d\n", ans);
  else
    printf("-1\n");
  return 0;
}
