#include <bits/stdc++.h>
using namespace std;
int u[100001], v[100001], c[100001], ans = 1000000007, a;
bool vis[100001];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= m; i++) {
    cin >> u[i] >> v[i] >> c[i];
  }
  for (int i = 1; i <= k; i++) {
    scanf("%d", &a);
    vis[a] = true;
  }
  for (int i = 1; i <= m; i++) {
    if (vis[u[i]] && !vis[v[i]] || !vis[u[i]] && vis[v[i]])
      ans = min(ans, c[i]);
  }
  if (ans != 1000000007)
    printf("%d\n", ans);
  else
    printf("-1\n");
  return 0;
}
