#include <bits/stdc++.h>
using namespace std;
int n, m, k, x;
struct nod {
  int x, y, z;
} s[100005];
bool t1, t2;
int main() {
  while (~scanf("%d%d%d", &n, &m, &k)) {
    for (int i = 0; i < m; i++) scanf("%d%d%d", &s[i].x, &s[i].y, &s[i].z);
    int mi = 0x3f3f3f3f;
    map<int, int> q;
    for (int i = 0; i < k; i++) {
      scanf("%d", &x);
      q[x] = 1;
    }
    for (int i = 0; i < m; i++) {
      t1 = q.count(s[i].x);
      t2 = q.count(s[i].y);
      if ((t1 && !t2) || (!t1 && t2)) mi = min(mi, s[i].z);
    }
    if (mi < 0x3f3f3f3f)
      printf("%d\n", mi);
    else
      printf("-1\n");
  }
}
