#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  vector<long long> v1;
  vector<long long> v2;
  vector<long long> v3;
  for (long long i = (0); i < (m); ++i) {
    long long a, b, c;
    cin >> a >> b >> c;
    v1.push_back(a);
    v2.push_back(b);
    v3.push_back(c);
  }
  long long d[100005];
  memset((d), (0), sizeof(d));
  for (long long i = (0); i < (k); ++i) {
    long long a;
    cin >> a;
    d[a] = 1;
  }
  long long mn = 1000000000000000LL;
  for (long long i = (0); i < (v1.size()); ++i) {
    if (d[v1[i]] == 1 && d[v2[i]] == 0) {
      mn = min(mn, v3[i]);
    }
    if (d[v1[i]] == 0 && d[v2[i]] == 1) {
      mn = min(mn, v3[i]);
    }
  }
  if (mn == 1000000000000000LL) {
    cout << -1 << endl;
  } else {
    printf("%I64d\n", mn);
  }
  return 0;
}
