#include <bits/stdc++.h>
using namespace std;
void edge(vector<pair<int, int> > adj[], int a, int b, int dis) {
  adj[a].push_back(make_pair(b, dis));
  adj[b].push_back(make_pair(a, dis));
}
void display(vector<pair<int, int> > adj[], int src) {
  for (int i = 0; i < adj[src].size(); i++) cout << adj[src][i].first << " ";
}
int main() {
  std::ios::sync_with_stdio(false);
  int n, m, k;
  cin >> n >> m >> k;
  vector<pair<int, int> > adj[n + 1];
  for (int i = 0; i < m; i++) {
    int u, v, l;
    cin >> u >> v >> l;
    edge(adj, u, v, l);
  }
  vector<bool> store(n + 1, false);
  for (int i = 0; i < k; i++) {
    int t;
    cin >> t;
    store[t] = true;
  }
  if (k == 0) {
    cout << -1 << endl;
    return 0;
  }
  int best = INT_MAX;
  for (int i = 0; i < store.size(); i++) {
    if (store[i]) {
      for (int j = 0; j < adj[i].size(); j++) {
        if (!store[adj[i][j].first]) {
          best = min(best, adj[i][j].second);
        }
      }
    }
  }
  if (best == INT_MAX) best = -1;
  cout << best << endl;
  return 0;
}
