#include <bits/stdc++.h>
using namespace std;
bool compare1(pair<int, int> a, pair<int, int> b) {
  return a.second < b.second;
}
struct compare {
  bool operator()(pair<int, int> a, pair<int, int> b) {
    return a.second > b.second;
  }
};
int main() {
  int N, M, K;
  cin >> N >> M >> K;
  vector<int> cnt(N);
  vector<priority_queue<pair<int, int>, vector<pair<int, int> >, compare> >
      Graph(N);
  vector<pair<pair<int, int>, int> > Data;
  for (int i = 0; i < M; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    Data.push_back(make_pair(make_pair(a, b), c));
  }
  vector<int> K1(K);
  for (int i = 0; i < K; i++) {
    int a;
    cin >> a;
    K1[i] = a;
    cnt[a - 1] = 1;
  }
  for (int i = 0; i < M; i++) {
    if (cnt[Data[i].first.second - 1] == 1 &&
        cnt[Data[i].first.first - 1] == 1) {
    } else {
      int a = Data[i].first.first;
      int b = Data[i].first.second;
      int c = Data[i].second;
      Graph[a - 1].push(make_pair(b - 1, c));
      Graph[b - 1].push(make_pair(a - 1, c));
    }
  }
  int min1 = -1;
  bool done = false;
  for (int i = 0; i < K; i++) {
    if (!Graph[K1[i] - 1].empty()) {
      if (!done) {
        min1 = Graph[K1[i] - 1].top().second;
        done = true;
      } else {
        min1 = min(min1, Graph[K1[i] - 1].top().second);
      }
    }
  }
  cout << min1;
  return 0;
}
