#include <bits/stdc++.h>
using namespace std;
int n, m, k, u, v, s, dd[123456];
vector<pair<int, int> > ke[123456];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> k;
  for (int i = 1; i <= m; i++) {
    cin >> u >> v >> s;
    ke[u].push_back(make_pair(v, s));
    ke[v].push_back(make_pair(u, s));
  }
  int ans = 1000000007;
  for (int i = 1; i <= k; i++) {
    cin >> u;
    dd[u] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (!dd[i]) continue;
    for (int j = 0; j < ke[i].size(); j++) {
      int v = ke[i][j].first;
      int u = ke[i][j].second;
      if (dd[v]) continue;
      ans = min(ans, u);
    }
  }
  if (ans == 1000000007) {
    cout << -1;
    return 0;
  }
  cout << ans;
  return 0;
}
