#include <bits/stdc++.h>
using namespace std;
vector<int> vis;
void dfs(vector<pair<int, int>> vec[], int i, int base, long long& temp) {
  if (i != base) vis[i] = 1;
  for (auto pp : vec[i]) {
    if (vis[pp.first] == 0) {
      temp = min<long long>(temp, pp.second);
    }
  }
}
void solve() {
  int n, m, k;
  cin >> n >> m >> k;
  if (!k) {
    cout << -1;
    return;
  }
  vector<pair<int, int>> vec[n + 1];
  for (int i = 0; i < m; i++) {
    int a, b, w;
    cin >> a >> b >> w;
    vec[a].push_back({b, w});
    vec[b].push_back({a, w});
  }
  vis.assign(n + 1, 0);
  for (int i = 0; i < k; i++) {
    int f;
    cin >> f;
    vis[f] = -1;
  }
  long long ans = 1e18;
  for (int i = 1; i <= n; i++) {
    if (vis[i] == -1) {
      long long temp = 1e18;
      dfs(vec, i, i, temp);
      ans = min<long long>(ans, temp);
    }
  }
  cout << (ans >= 1e18 ? -1 : ans);
}
int main() {
  solve();
  cout << endl;
  return 0;
}
