#include <bits/stdc++.h>
using namespace std;
bool dd[100005];
long long u[100005], v[100005], w[100005], mind = 2000000000000;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= m; i++) {
    cin >> u[i] >> v[i] >> w[i];
  }
  for (int i = 1; i <= k; i++) {
    int x;
    cin >> x;
    dd[x] = 1;
  }
  for (int i = 1; i <= m; i++) {
    if (dd[u[i]] + dd[v[i]] == 1 && mind > w[i]) mind = w[i];
  }
  if (mind == 2000000000000)
    cout << "-1";
  else
    cout << mind;
  return 0;
}
