#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long mod = 1e9 + 7;
map<int, int> t;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<pair<int, int> > g;
  vector<int> z(m);
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y >> z[i];
    x--, y--;
    g.push_back(make_pair(x, y));
  }
  if (k == 0) {
    cout << "-1\n";
    return 0;
  }
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    x--;
    t[x] = 1;
  }
  int ans = INF;
  for (int i = 0; i < m; i++)
    if (t[g[i].first] && !t[g[i].second] || !t[g[i].first] && t[g[i].second])
      ans = min(ans, z[i]);
  if (ans == INF)
    cout << "-1\n";
  else
    cout << ans << "\n";
  return 0;
}
