#include <bits/stdc++.h>
#pragma warning(disable : 4786)
#pragma warning(disable : 4996)
using namespace std;
vector<int> node[100005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  long long u[m], v[m], l[m];
  bool b[n + 1];
  memset(b, true, sizeof(b));
  for (int i = 0; i < m; i++) {
    cin >> u[i] >> v[i] >> l[i];
  }
  for (int i = 0; i < k; i++) {
    int a;
    cin >> a;
    b[a] = false;
  }
  long long mn = 1000000000000;
  for (int i = 0; i < m; i++) {
    if ((b[u[i]] == true || b[v[i]] == true) &&
        (b[u[i]] == false || b[v[i]] == false)) {
      if ((b[u[i]] == false && b[v[i]] == false)) continue;
      mn = min(mn, l[i]);
    }
  }
  if (mn == 1000000000000) mn = -1;
  cout << mn;
}
