#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = INF + 7;
int main(void) {
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<pair<int, int> > > mp(n);
  for (int(i) = 0; (i) < (m); (i)++) {
    int u, v, l;
    scanf("%d%d%d", &u, &v, &l);
    u--;
    v--;
    mp[u].emplace_back(make_pair(v, l));
    mp[v].emplace_back(make_pair(u, l));
  }
  if (k == 0 || k == n) {
    cout << -1 << endl;
    return 0;
  }
  bool f = false;
  int ans = INF;
  set<int> s;
  vector<int> a(k);
  for (int(i) = 0; (i) < (k); (i)++) {
    scanf("%d", &a[i]);
    a[i]--;
    s.insert(a[i]);
  }
  for (int(i) = 0; (i) < (k); (i)++) {
    for (int(j) = 0; (j) < (mp[a[i]].size()); (j)++) {
      if (s.find(mp[a[i]][j].first) != s.end()) continue;
      f = true;
      ans = min(ans, mp[a[i]][j].second);
    }
  }
  if (f)
    cout << ans << endl;
  else
    cout << -1 << endl;
}
