#include <bits/stdc++.h>
using namespace std;
const double inf = 1e15;
struct node {
  int u, v, w;
} e[100005];
int vis[100005];
int main() {
  int n, m, k, u;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < m; ++i) {
    scanf("%d%d%d", &e[i].u, &e[i].v, &e[i].w);
  }
  for (int i = 0; i < k; ++i) {
    scanf("%d", &u);
    vis[u] = 1;
  }
  long long ans = inf;
  for (int i = 0; i < m; ++i) {
    if (vis[e[i].u] + vis[e[i].v] == 1) {
      if (ans > e[i].w) ans = e[i].w;
    }
  }
  if (ans == inf) ans = -1;
  cout << ans << endl;
  return 0;
}
