#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
struct node {
  int be, en;
  int val;
} tree[N];
int u[N];
int main() {
  int n, m, k;
  while (cin >> n >> m >> k) {
    memset(u, 0, sizeof(u));
    for (int i = 0; i < m; i++) {
      cin >> tree[i].be >> tree[i].en >> tree[i].val;
    }
    for (int i = 0; i < k; i++) {
      int x;
      cin >> x;
      u[x] = 1;
    }
    int ans = 1e9 + 7;
    for (int i = 0; i < m; i++) {
      if ((u[tree[i].be] + u[tree[i].en]) == 1) {
        ans = min(ans, tree[i].val);
      }
    }
    if (ans == 1e9 + 7)
      cout << -1 << endl;
    else
      cout << ans << endl;
  }
  return 0;
}
