#include <bits/stdc++.h>
using namespace std;
struct node {
  int u, v, l;
} a[100050];
int cmp(node a, node b) { return a.l < b.l; }
int main() {
  int n, m, k, vis[100050];
  memset(vis, 0, sizeof(vis));
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &a[i].u, &a[i].v, &a[i].l);
  }
  for (int i = 1; i <= k; i++) {
    int p;
    scanf("%d", &p);
    vis[p] = 1;
  }
  sort(a + 1, a + 1 + m, cmp);
  for (int i = 1; i <= m; i++) {
    if (vis[a[i].u] != vis[a[i].v]) {
      cout << a[i].l << endl;
      return 0;
    }
  }
  cout << -1 << endl;
}
