#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, k;
  cin >> n >> m >> k;
  vector<pair<int, int> > adj[100005];
  for (int i = 0; i < m; i++) {
    int u, v, l;
    cin >> u >> v >> l;
    adj[u].push_back(make_pair(v, l));
    adj[v].push_back(make_pair(u, l));
  }
  if (!k) {
    cout << -1 << endl;
    return 0;
  }
  bool storages[n + 1];
  memset(storages, false, sizeof(storages));
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    storages[x] = true;
  }
  int mind = INT_MAX;
  for (int i = 1; i <= n; i++) {
    if (storages[i]) {
      for (int j = 0; j < adj[i].size(); j++) {
        if (!storages[adj[i][j].first]) {
          mind = min(mind, adj[i][j].second);
        }
      }
    }
  }
  if (mind == INT_MAX) {
    cout << -1 << endl;
  } else {
    cout << mind << endl;
  }
  return 0;
}
