#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const int MAXM = 1e5 + 5;
int T, N, M, K, cas;
struct Edge {
  int u, v, w;
  Edge() {}
  Edge(int u, int v, int w) : u(u), v(v), w(w) {}
  bool operator<(const Edge& e) const { return w < e.w; }
} edges[MAXM];
int tot;
bool F[MAXN];
void init() {
  tot = 0;
  memset(F, false, sizeof(F));
}
void add_edge(int u, int v, int w) { edges[tot++] = Edge(u, v, w); }
int main() {
  int u, v, w;
  while (~scanf("%d %d %d", &N, &M, &K)) {
    init();
    for (int i = 0; i < M; i++) {
      scanf("%d %d %d", &u, &v, &w);
      add_edge(u, v, w);
    }
    for (int i = 0; i < K; i++) {
      scanf("%d", &u);
      F[u] = true;
    }
    int res = INF;
    for (int i = 0; i < M; i++) {
      u = edges[i].u, v = edges[i].v, w = edges[i].w;
      if (F[u] == F[v]) continue;
      res = min(res, w);
    }
    if (res == INF)
      printf("-1");
    else
      printf("%d\n", res);
  }
  return 0;
}
