#include <bits/stdc++.h>
using namespace std;
struct t {
  int x, y;
} cor[100001];
long long n, ar[100001], a, b, c, d, m, k, u[100001];
vector<int> vec[100001];
vector<long long> v[100001];
int main() {
  long long ans = 1e15;
  cin >> n >> m >> k;
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", &a, &b, &c);
    vec[a].push_back(b);
    vec[b].push_back(a);
    v[a].push_back(c);
    v[b].push_back(c);
  }
  for (int i = 0; i < k; i++) {
    scanf("%d", &ar[i]);
    u[ar[i]] = 1;
  }
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < vec[ar[i]].size(); j++) {
      if (u[vec[ar[i]][j]] == 0) {
        ans = min(ans, v[ar[i]][j]);
      }
    }
  }
  if (ans > 1e9) {
    cout << "-1";
  } else
    cout << ans;
  return 0;
}
