#include <bits/stdc++.h>
using namespace std;
deque<pair<int, int> > deq[100001];
bool has[100001];
int ar[100001];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= m; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    deq[u].push_back(make_pair(v, w));
    deq[v].push_back(make_pair(u, w));
  }
  for (int i = 1; i <= k; i++) {
    cin >> ar[i];
    has[ar[i]] = 1;
  }
  int ans = 2 * 1e9;
  for (int i = 1; i <= k; i++) {
    for (int j = 0; j < deq[ar[i]].size(); j++) {
      if (!has[deq[ar[i]][j].first]) ans = min(ans, deq[ar[i]][j].second);
    }
  }
  if (ans == 2 * 1e9)
    cout << -1 << endl;
  else
    cout << ans << endl;
}
