#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
struct point {
  int x, c;
  point(int _x = 0, int _c = 0) {
    x = _x;
    c = _c;
  }
};
vector<point> v[N];
bool check[N];
int ans;
void DW(int x) {
  for (int i = 0; i < v[x].size(); i++) {
    if (!check[v[x][i].x]) {
      if (ans == -1) {
        ans = v[x][i].c;
      } else
        ans = min(v[x][i].c, ans);
    }
  }
}
int main() {
  int n, m, k;
  int l, r, c;
  while (~scanf("%d%d%d", &n, &m, &k)) {
    for (int i = 1; i <= n; i++) v[i].clear();
    for (int i = 1; i <= m; i++) {
      scanf("%d%d%d", &l, &r, &c);
      v[l].push_back(point(r, c));
      v[r].push_back(point(l, c));
    }
    memset(check, 0, sizeof(check));
    for (int i = 1; i <= k; i++) {
      scanf("%d", &c);
      check[c] = 1;
    }
    ans = -1;
    for (int i = 1; i <= n; i++) {
      if (check[i]) {
        DW(i);
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
