#include <bits/stdc++.h>
using namespace std;
template <class T>
bool mini(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool maxi(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  int n, m, k;
  cin >> n >> m >> k;
  vector<pair<int, int> > adj[n + 3];
  vector<int> mark(n + 3, 0);
  for (int i = 0; i < (int)(m); i++) {
    int u, v, w;
    cin >> u >> v >> w;
    adj[u].push_back({v, w});
    adj[v].push_back({u, w});
  }
  for (int i = 0; i < (int)(k); i++) {
    int u;
    cin >> u;
    mark[u] = 1;
  }
  int ans = 1e9 + 3;
  for (int i = 1; i <= (int)(n); i++) {
    if (mark[i]) {
      for (auto j : adj[i]) {
        if (!mark[j.first]) mini(ans, j.second);
      }
    }
  }
  if (ans == 1e9 + 3)
    cout << "-1";
  else
    cout << ans;
}
