#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005], c[100005], v[100005];
int main() {
  int n, m, k, i, mi, chk, x, y, z;
  cin >> n >> m >> k;
  for (i = 1; i <= m; i++) {
    scanf("%d %d %d", &a[i], &b[i], &c[i]);
  }
  for (i = 1; i <= k; i++) {
    scanf("%d", &x);
    v[x] = 1;
  }
  mi = 1000000005;
  chk = 1;
  for (i = 1; i <= m; i++) {
    x = a[i];
    y = b[i];
    z = c[i];
    if ((v[x] == 0 && v[y] == 1) || (v[x] == 1 && v[y] == 0)) {
      chk = 0;
      mi = min(mi, z);
    }
  }
  if (chk == 0)
    cout << mi;
  else
    cout << -1;
}
