#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > adj[100005];
set<long long> s;
int main() {
  long long n, m, k, i, j, u, v, l, a[100005];
  set<long long> s;
  long long mini = 1e15;
  cin >> n >> m >> k;
  for (i = 0; i < m; i++) {
    cin >> u >> v >> l;
    adj[u].push_back(make_pair(v, l));
    adj[v].push_back(make_pair(u, l));
  }
  for (i = 0; i < k; i++) {
    cin >> a[i];
    s.insert(a[i]);
  }
  for (i = 0; i < k; i++) {
    for (j = 0; j < adj[a[i]].size(); j++) {
      if (s.find(adj[a[i]][j].first) != s.end()) {
      } else {
        mini = min(adj[a[i]][j].second, mini);
      }
    }
  }
  if (mini == 1e15) {
    cout << -1;
  } else {
    cout << mini;
  }
}
