#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int n, m, k;
vector<int> adj[N];
set<int> st;
map<pair<int, int>, int> mp;
int main() {
  std::ios_base::sync_with_stdio(false);
  cin >> n >> m >> k;
  for (int i = 0; i < m; i++) {
    int u, v, c;
    cin >> u >> v >> c;
    adj[u].push_back(v);
    adj[v].push_back(u);
    if (mp[{u, v}] == 0 || mp[{v, u}] == 0) {
      mp[{u, v}] = c;
      mp[{v, u}] = c;
    } else {
      mp[{u, v}] = min(c, mp[{u, v}]);
      mp[{v, u}] = min(c, mp[{v, u}]);
    }
  }
  int ans = 1e9 + 7;
  for (int i = 0; i < k; i++) {
    int a;
    cin >> a;
    st.insert(a);
  }
  for (auto x : st) {
    for (auto y : adj[x]) {
      if (st.find(y) == st.end()) {
        ans = min({ans, mp[{x, y}], mp[{y, x}]});
      }
    }
  }
  if (ans == 1e9 + 7) {
    cout << -1;
    return 0;
  }
  cout << ans;
}
