#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 5;
int n, m, k, a[N], u[N], v[N], l[N];
bool book[N] = {0};
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= m; i++) scanf("%d%d%d", &u[i], &v[i], &l[i]);
  for (int i = 1; i <= k; i++) scanf("%d", &a[i]), book[a[i]] = 1;
  int minn = INF;
  for (int i = 1; i <= m; i++) {
    if (book[u[i]] && !book[v[i]] || book[v[i]] && !book[u[i]])
      minn = min(minn, l[i]);
  }
  if (minn >= INF)
    cout << -1;
  else
    cout << minn;
}
