#include <bits/stdc++.h>
using namespace std;
long long sz, nedge, k, out = 1e17;
map<long long, map<long long, long long>> adj_list;
vector<bool> storage(1e6, false);
void span(long long curr) {
  for (map<long long, long long>::iterator myit = adj_list[curr].begin();
       myit != adj_list[curr].end(); myit++) {
    if (storage[myit->first] == false) {
      out = min(out, myit->second);
    }
  }
}
int main() {
  cin >> sz >> nedge >> k;
  for (long long i = 0; i < nedge; i++) {
    long long t1, t2, v;
    cin >> t1 >> t2 >> v;
    t1--;
    t2--;
    if (adj_list[t1][t2] == 0) {
      adj_list[t1][t2] = v;
    } else {
      adj_list[t1][t2] = min(v, adj_list[t1][t2]);
    }
    adj_list[t2][t1] = adj_list[t1][t2];
  }
  vector<long long> tstroage(k);
  for (long long i = 0; i < k; i++) {
    cin >> tstroage[i];
    tstroage[i]--;
    storage[tstroage[i]] = true;
  }
  for (long long i = 0; i < k; i++) {
    span(tstroage[i]);
  }
  if (out == 1e17) {
    cout << "-1" << endl;
  } else {
    cout << out << endl;
  }
  return 0;
}
