#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
bool check[MAXN];
vector<pair<int, int> > e;
long long int w[MAXN];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < m; i++) {
    int x, y, l;
    cin >> x >> y >> l;
    e.push_back(make_pair(x, y));
    w[i] = l;
  }
  for (int i = 0, cur; i < k; i++) {
    cin >> cur;
    check[cur] = 1;
  }
  long long int ans = 99999999999;
  for (int i = 0; i < e.size(); i++) {
    int st = e[i].first;
    int en = e[i].second;
    if (check[st] == 1 && check[en] == 0) {
      ans = min(ans, w[i]);
    }
    if (check[en] == 1 && check[st] == 0) {
      ans = min(ans, w[i]);
    }
  }
  if (ans == 99999999999)
    cout << -1 << endl;
  else
    cout << ans << endl;
}
