#include <bits/stdc++.h>
using namespace std;
struct node {
  int u, v, l;
} a[100005];
bool vis[100005];
int x[100005];
int main() {
  int n, m, k;
  while (~scanf("%d%d%d", &n, &m, &k)) {
    memset(vis, false, sizeof(vis));
    memset(a, 0x3f3f3f3f, sizeof(a));
    for (int i = 0; i < m; i++) scanf("%d%d%d", &a[i].u, &a[i].v, &a[i].l);
    int minn = 0x3f3f3f3f;
    for (int i = 0; i < k; i++) {
      scanf("%d", &x[i]);
      vis[x[i]] = true;
    }
    for (int i = 0; i < m; i++) {
      if (vis[a[i].u] == false && vis[a[i].v] == true) minn = min(minn, a[i].l);
      if (vis[a[i].v] == false && vis[a[i].u] == true) minn = min(minn, a[i].l);
    }
    if (minn == 0x3f3f3f3f)
      printf("-1\n");
    else
      printf("%d\n", minn);
  }
  return 0;
}
