#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;
using vpii = vector<pair<int, int>>;
using vpll = vector<pair<ll, ll>>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
void solve() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<pii>> adj(n + 1);
  set<int> a;
  for (ll i = 0; i < (m); i++) {
    int x, y, w;
    cin >> x >> y >> w;
    adj[x].push_back(make_pair(y, w));
    adj[y].push_back(make_pair(x, w));
  }
  if (k > 0) {
    for (ll i = 0; i < (k); i++) {
      int l = 0;
      cin >> l;
      a.insert(l);
    }
  }
  int min = INT_MAX;
  int minCty = -1;
  for (int x : a) {
    for (auto t : adj[x]) {
      if (t.second < min && a.count(t.first) == 0) {
        min = t.second;
        minCty = t.first;
      }
    }
  }
  if (minCty == -1)
    cout << -1 << endl;
  else
    cout << min << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  solve();
}
