#include <bits/stdc++.h>
using namespace std;
bool can[100005] = {0};
int a[100005], b[100005];
long long int c[100005];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < m; i++) {
    cin >> a[i] >> b[i] >> c[i];
  }
  int q;
  for (int i = 0; i < k; i++) {
    cin >> q;
    can[q] = 1;
  }
  long long int ans = 1e10;
  for (int i = 0; i < m; i++) {
    if (can[a[i]] && can[b[i]]) continue;
    if (!can[a[i]] && !can[b[i]]) continue;
    ans = min(ans, c[i]);
  }
  if (ans == 1e10)
    cout << "-1";
  else
    cout << ans;
  return 0;
}
