#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int store[100000] = {0}, e = 1;
  long long int edge[100000] = {0}, n, m, k, a, b, c;
  vector<pair<long long, long long> > v;
  cin >> n >> m >> k;
  for (long long i = 0; i < m; i++) {
    cin >> a >> b >> c;
    edge[i] = c;
    v.push_back(make_pair(a, b));
  }
  for (long long int i = 0; i < k; i++) {
    cin >> a;
    store[a] = 1;
  }
  long long min = INT_MAX;
  for (long long int i = 0; i < m; i++) {
    if (store[v[i].first] == 1 && store[v[i].second] == 1)
      e = 1;
    else if (store[v[i].first] == 1 || store[v[i].second] == 1) {
      if (edge[i] < min) min = edge[i];
    }
  }
  if (min == INT_MAX)
    cout << -1;
  else
    cout << min;
  return 0;
}
