#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const long long mod = (long long)1e9 + 7;
const double pi = acos(-1.0);
const double eps = (double)1e-9;
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};
const int N = 605;
vector<pair<int, int> > vd[N];
int n, m, k, lim, cnt[N], d[N][N];
struct edge {
  int fr, to, cp, fl;
  edge(){};
  edge(int x, int y, int z) : fr(x), to(y), cp(z), fl(0){};
};
vector<edge> e;
vector<int> g[N + N];
int di[N + N], ptr[N + N];
inline void add_edge(int fr, int to, int cp) {
  g[fr].push_back((int)e.size());
  e.push_back(edge(fr, to, cp));
  g[to].push_back((int)e.size());
  e.push_back(edge(to, fr, 0));
}
inline bool bfs() {
  for (int i = 0; i <= n + n + 1; i++) di[i] = inf;
  di[0] = 0;
  queue<int> q;
  q.push(0);
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (auto i : g[v]) {
      if (e[i].fl < e[i].cp && di[e[i].fr] + 1 < di[e[i].to]) {
        di[e[i].to] = di[e[i].fr] + 1;
        q.push(e[i].to);
      }
    }
  }
  return di[n + n + 1] != inf;
}
int dfs(int v, int fn, int fl = inf) {
  if (v == fn || !fl) return fl;
  while (ptr[v] < (int)g[v].size()) {
    int i = g[v][ptr[v]];
    if (di[e[i].fr] + 1 == di[e[i].to] && e[i].fl < e[i].cp) {
      int cur = dfs(e[i].to, fn, min(fl, e[i].cp - e[i].fl));
      if (cur) {
        e[i].fl += cur;
        e[i ^ 1].fl -= cur;
        return cur;
      }
    }
    ptr[v]++;
  }
  return 0;
}
inline int max_flow() {
  int res = 0;
  while (bfs()) {
    memset(ptr, 0, sizeof(ptr));
    while (1) {
      int cur = dfs(0, n + n + 1);
      if (!cur) break;
      res += cur;
    }
  }
  return res;
}
inline bool check(int x) {
  e.clear();
  for (int i = 0; i <= n + n + 1; i++) g[i].clear();
  for (int i = 1; i <= n; i++) {
    add_edge(i + n, n + n + 1, 1);
    if (!cnt[i]) continue;
    bool found = 0;
    for (int j = 1; j <= n; j++) {
      if (d[i][j] <= x) {
        found = 1;
        add_edge(i, j + n, cnt[i]);
      }
    }
    if (found) add_edge(0, i, cnt[i]);
  }
  return (max_flow() >= lim);
}
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> k >> lim;
  for (int i = 1; i <= k; i++) {
    int x;
    cin >> x;
    cnt[x]++;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) d[i][j] = inf;
  for (int i = 1; i <= n; i++) d[i][i] = 0;
  for (int i = 1; i <= m; i++) {
    int x, y, z;
    cin >> x >> y >> z;
    vd[x].push_back({y, z});
    vd[y].push_back({x, z});
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) d[i][j] = inf;
  for (int i = 1; i <= n; i++) {
    if (!cnt[i]) continue;
    d[i][i] = 0;
    set<pair<int, int> > s;
    s.insert({0, i});
    while (!s.empty()) {
      pair<int, int> p = *s.begin();
      s.erase(s.begin());
      int v = p.second;
      for (auto j : vd[v]) {
        int to = j.first;
        int cost = j.second;
        if (d[i][v] + cost < d[i][to]) {
          s.erase({d[i][to], to});
          d[i][to] = d[i][v] + cost;
          s.insert({d[i][to], to});
        }
      }
    }
  }
  int l = 0, r = 1731311, ans = -1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid)) {
      ans = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  cout << ans;
  return 0;
}
