#include <bits/stdc++.h>
using namespace std;
const int maxN = 1e5 + 10;
vector<pair<int, int> > adj[maxN];
bool mark[maxN];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < m; i++) {
    int u, v, l;
    cin >> u >> v >> l;
    u--, v--;
    adj[u].push_back(make_pair(v, l));
    adj[v].push_back(make_pair(u, l));
  }
  vector<int> st;
  for (int i = 0; i < k; i++) {
    int v;
    cin >> v;
    v--;
    st.push_back(v);
    mark[v] = 1;
  }
  int ans = 2e9;
  for (int i = 0; i < k; i++) {
    int v = st[i];
    for (int j = 0; j < adj[v].size(); j++) {
      int u = adj[v][j].first;
      if (mark[u]) continue;
      ans = min(ans, adj[v][j].second);
    }
  }
  if (ans == 2e9) ans = -1;
  cout << ans << endl;
  return 0;
}
