#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5;
const long long INF = 1e10;
vector<pair<int, int> > g[MAXN];
vector<long long> v;
unordered_set<long long> s;
int main() {
  ios_base::sync_with_stdio(0);
  long long n, m, k;
  cin >> n >> m >> k;
  if (k == 0) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < m; ++i) {
    long long a, b, c;
    cin >> a >> b >> c;
    --a, --b;
    g[a].push_back(make_pair(b, c));
    g[b].push_back(make_pair(a, c));
  }
  for (int h = 0; h < k; ++h) {
    long long a;
    cin >> a;
    --a;
    v.push_back(a);
    s.insert(a);
  }
  long long mi = INF;
  for (int i = 0; i < k; ++i) {
    for (auto j : g[v[i]]) {
      if (!s.count(j.first)) {
        mi = min(mi, (long long)j.second);
      }
    }
  }
  if (mi < INF) {
    cout << mi;
  } else {
    cout << -1;
  }
  return 0;
}
