#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
const long long lf = 1e11 + 9;
struct point {
  long long next;
  long long to;
  long long val;
};
point pt[maxn];
long long head[maxn], q, c[maxn];
void add(long long u, long long v, long long val) {
  pt[q].next = head[u];
  pt[q].to = v;
  pt[q].val = val;
  head[u] = q++;
}
int main() {
  long long n, m, k, u, v, val;
  while (cin >> n >> m >> k) {
    map<long long, long long> mp;
    q = 1;
    memset(head, -1, sizeof(head));
    for (int i = 0; i < m; i++) {
      cin >> u >> v >> val;
      add(u, v, val);
      add(v, u, val);
    }
    for (int i = 0; i < k; i++) {
      cin >> c[i];
      mp[c[i]] = 1;
    }
    if (k == 0 || n - k <= 0)
      cout << "-1" << endl;
    else {
      long long inf = lf;
      for (int i = 0; i < k; i++) {
        for (int j = head[c[i]]; j != -1; j = pt[j].next) {
          if (pt[j].val < inf && mp[pt[j].to] != 1) inf = pt[j].val;
        }
      }
      if (inf != lf)
        cout << inf << endl;
      else
        cout << "-1" << endl;
    }
  }
  return 0;
}
