#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T lowbit(T x) {
  return x & (-x);
}
const int INF = 1e9 + 7;
const int MAXN = 1e5 + 5;
vector<pair<int, int> > G[MAXN];
vector<int> B;
int is_b[MAXN];
int n, m, k;
int main(void) {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < m; i++) {
    int u, v, l;
    scanf("%d%d%d", &u, &v, &l);
    G[u].push_back(pair<int, int>(v, l));
    G[v].push_back(pair<int, int>(u, l));
  }
  for (int i = 0; i < k; i++) {
    int u;
    scanf("%d", &u);
    is_b[u] = true;
    B.push_back(u);
  }
  int ans = INF;
  for (int i = 0; i < k; i++) {
    int u = B[i];
    for (auto &v : G[u]) {
      if (!is_b[v.first]) {
        ans = min(ans, v.second);
      }
    }
  }
  if (ans == INF) ans = -1;
  printf("%d\n", ans);
  return 0;
}
