#include <bits/stdc++.h>
using namespace std;
vector<pair<long long int, long long int> > V[100005];
int cake[100005];
set<int> S;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= m; ++i) {
    long long int a, b, c;
    scanf("%I64d %I64d %I64d", &a, &b, &c);
    V[a].push_back(make_pair(b, c));
    V[b].push_back(make_pair(a, c));
  }
  long long int ans = -1;
  for (int i = 1; i <= k; ++i) {
    scanf("%d", &cake[i]);
    S.insert(cake[i]);
  }
  for (int i = 1; i <= k; ++i) {
    for (int j = 0; j < V[cake[i]].size(); ++j) {
      if (S.find(V[cake[i]][j].first) == S.end()) {
        if (ans == -1)
          ans = V[cake[i]][j].second;
        else
          ans = min(ans, V[cake[i]][j].second);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
