#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m, k;
  cin >> n >> m >> k;
  map<int, int> m2;
  map<int, vector<pair<int, int>>> make_pair;
  for (auto i = 1; i <= m; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    make_pair[a].push_back({b, c});
    make_pair[b].push_back({a, c});
  }
  for (auto i = 1; i <= k; i++) {
    int x;
    cin >> x;
    m2[x]++;
  }
  int dist = INT_MAX;
  bool b = 0;
  for (auto x : make_pair) {
    if (m2[x.first]) {
      for (auto y : make_pair[x.first]) {
        if (m2[y.first]) {
          continue;
        }
        b = 1;
        dist = min(dist, y.second);
      }
    }
  }
  if (!b) {
    cout << "-1\n";
    return;
  }
  cout << dist << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
