#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
const int inf = 0x3f3f3f3f;
vector<vector<pair<int, int>>> g;
int n, m, k;
bool vis[maxn];
int main() {
  cin >> n >> m >> k;
  g = vector<vector<pair<int, int>>>(n + 1);
  for (int i = 1; i <= m; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    g[u].push_back(make_pair(v, w));
    g[v].push_back(make_pair(u, w));
  }
  int mindist = inf;
  for (int i = 1; i <= k; i++) {
    int x;
    cin >> x;
    vis[x] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (vis[i]) {
      for (auto it : g[i]) {
        if (!vis[it.first]) {
          mindist = min(mindist, it.second);
        }
      }
    }
  }
  if (mindist == inf)
    cout << -1 << endl;
  else
    cout << mindist << endl;
  return 0;
}
