#include <bits/stdc++.h>
const int inf = 0x3f3f3f3f;
using namespace std;
int n, m, k;
bool book[100010];
typedef struct edge {
  int to, cost;
} edge;
vector<edge> G[100010];
int storage[100010];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  fill(book, book + n + 1, false);
  if (k == 0) {
    printf("-1\n");
    return 0;
  }
  int u, v, l;
  edge temp;
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", &u, &v, &l);
    temp.to = v, temp.cost = l;
    G[u].push_back(temp);
    temp.to = u;
    G[v].push_back(temp);
  }
  for (int i = 0; i < k; i++) {
    scanf("%d", &storage[i]);
    book[storage[i]] = true;
  }
  int Min = inf;
  for (int i = 0; i < k; i++) {
    int cur = storage[i];
    for (int j = 0; j < G[cur].size(); j++) {
      if (!book[G[cur][j].to]) Min = min(Min, G[cur][j].cost);
    }
  }
  if (Min == inf)
    printf("-1\n");
  else
    printf("%d\n", Min);
  return 0;
}
