#include <bits/stdc++.h>
using namespace std;
int main() {
  int V, E, K;
  cin >> V >> E >> K;
  vector<vector<pair<int, long long int> > > g(V + 1);
  int u, v;
  long long int w;
  for (int i = 0; i < E; i++) {
    cin >> u >> v >> w;
    g[u].push_back(make_pair(v, w));
    g[v].push_back(make_pair(u, w));
  }
  long long int cost = LONG_MAX;
  vector<bool> vis(V + 1);
  for (int i = 0; i < K; i++) {
    int x;
    cin >> x;
    vis[x] = true;
  }
  for (int i = 1; i <= V; i++) {
    if (vis[i]) {
      for (int j = 0; j < g[i].size(); j++) {
        if (!vis[g[i][j].first]) cost = min(cost, g[i][j].second);
      }
    }
  }
  if (cost != LONG_MAX)
    cout << cost << endl;
  else
    cout << -1 << endl;
  return 0;
}
