#include <bits/stdc++.h>
using namespace std;
int x[100001], y[100001], z[100001], n, m, k, Min, i, w;
bool v[100001];
int main() {
  cin >> n >> m >> k;
  for (i = 1; i <= m; i++) cin >> x[i] >> y[i] >> z[i];
  for (i = 1; i <= k; i++) cin >> w, v[w] = true;
  Min = 1 << 30;
  for (i = 1; i <= m; i++)
    if ((v[x[i]] == true && v[y[i]] == false) ||
        (v[x[i]] == false && v[y[i]] == true))
      Min = min(Min, z[i]);
  if (Min == (1 << 30))
    cout << -1;
  else
    cout << Min;
  return 0;
}
