#include <bits/stdc++.h>
using namespace std;
const int Z = (int)1e5 + 111;
const int inf = (int)1e9 + 111;
const long long llinf = (long long)inf * inf;
const long double pi = acos(-1.0);
vector<pair<int, int> > g[Z];
map<int, int> a;
int n, m, k, ans = inf;
int main() {
  cin >> n >> m >> k;
  while (m-- > 0) {
    int x, y, z;
    cin >> x >> y >> z;
    g[x].push_back({y, z});
    g[y].push_back({x, z});
  }
  for (int i = 1; i <= k; i++) {
    int x;
    cin >> x;
    a[x] = 1;
  }
  for (auto it : a) {
    if (a[it.first]) {
      for (auto ik : g[it.first]) {
        if (!a[ik.first]) {
          ans = min(ans, ik.second);
        }
      }
    }
  }
  if (ans == inf) {
    cout << -1;
  } else {
    cout << ans;
  }
}
