#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
struct node {
  long long cost;
  int to;
};
bool cmp(node c1, node c2) { return c1.cost < c2.cost; }
vector<node> edge[N];
int book[N];
int a[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  long long x, y, z;
  for (int i = 1; i <= m; i++) {
    cin >> x >> y >> z;
    node c1;
    c1.cost = z, c1.to = y;
    edge[x].push_back(c1);
    c1.to = x;
    edge[y].push_back(c1);
  }
  for (int i = 1; i <= k; i++) {
    cin >> a[i];
    book[a[i]] = 1;
  }
  vector<node> ve;
  for (int i = 1; i <= k; i++) {
    for (auto tt : edge[a[i]]) {
      ve.push_back(tt);
    }
  }
  sort(ve.begin(), ve.end(), cmp);
  for (int i = 0; i < ve.size(); i++) {
    if (!book[ve[i].to]) {
      cout << ve[i].cost << endl;
      return 0;
    }
  }
  cout << -1 << endl;
}
