#include <bits/stdc++.h>
using namespace std;
int main() {
  int a_v, a_e, a_s;
  cin >> a_v >> a_e >> a_s;
  vector<vector<pair<int, int>>> graph(a_v);
  map<int, bool> res;
  vector<long long int> reslist;
  long long int a, b, l;
  for (int i = 0; i < a_e; i++) {
    cin >> a >> b >> l;
    graph[a - 1].push_back(make_pair(b - 1, l));
    graph[b - 1].push_back(make_pair(a - 1, l));
  }
  long long int min = numeric_limits<long long int>::max();
  for (int i = 0; i < a_s; i++) {
    cin >> a;
    res[a - 1] = true;
    reslist.push_back(a - 1);
  }
  for (int it : reslist) {
    for (auto v : graph[it]) {
      if (!res[v.first] && v.second < min) {
        min = v.second;
      }
    }
  }
  if (min != numeric_limits<long long int>::max())
    cout << min;
  else
    cout << "-1";
}
