#include <bits/stdc++.h>
using namespace std;
const int maxv = 650, maxe = 20050, maxn = 220, Big = 1731312;
int V, E, n, K, st[maxn], ans;
int es1 = 0, he1[maxv], ne1[maxe * 2], to1[maxe * 2], di[maxe * 2];
int dis[maxv][maxv];
priority_queue<pair<int, int>, vector<pair<int, int> >,
               greater<pair<int, int> > >
    heap;
int es2, he2[maxn], ne2[maxn * maxv], to2[maxn * maxv];
int mat[maxv];
bool visx[maxn];
void ins1(int u, int v, int d0) {
  ne1[++es1] = he1[u], he1[u] = es1, to1[es1] = v, di[es1] = d0;
}
void get_dis(int s) {
  if (!dis[s][s]) return;
  int i, x, y;
  dis[s][s] = 0;
  heap.push(make_pair(0, s));
  while (!heap.empty()) {
    pair<int, int> t = heap.top();
    heap.pop();
    x = t.second;
    if (dis[s][x] < t.first) continue;
    for (i = he1[x]; i; i = ne1[i])
      if (dis[s][y = to1[i]] > dis[s][x] + di[i]) {
        dis[s][y] = dis[s][x] + di[i];
        heap.push(make_pair(dis[s][y], y));
      }
  }
}
void ins2(int u, int v) { ne2[++es2] = he2[u], he2[u] = es2, to2[es2] = v; }
bool find(int x) {
  int i, y;
  visx[x] = 1;
  for (i = he2[x]; i; i = ne2[i])
    if (!mat[y = to2[i]] || (!visx[mat[y]] && find(mat[y]))) {
      mat[y] = x;
      return 1;
    }
  return 0;
}
bool judg(int tim) {
  int i, j, k = 0;
  es2 = 0;
  memset(he2, 0, sizeof(he2));
  for (i = 1; i <= n; i++)
    for (j = 1; j <= V; j++)
      if (dis[st[i]][j] <= tim) ins2(i, j);
  memset(mat, 0, sizeof(mat));
  for (i = 1; i <= n; i++) {
    memset(visx, 0, sizeof(visx));
    k += find(i);
  }
  return k >= K;
}
int Binary() {
  int L = 0, R = Big, mid;
  while (L < R) {
    mid = (L + R) >> 1;
    if (judg(mid))
      R = mid;
    else
      L = mid + 1;
  }
  return L == Big ? -1 : L;
}
int main() {
  int i, j, x, y, d0;
  scanf("%d%d%d%d", &V, &E, &n, &K);
  for (i = 1; i <= n; i++) scanf("%d", &st[i]);
  for (i = 0; i < E; i++)
    scanf("%d%d%d", &x, &y, &d0), ins1(x, y, d0), ins1(y, x, d0);
  memset(dis, 0x3f, sizeof(dis));
  for (i = 1; i <= n; i++) get_dis(st[i]);
  ans = Binary();
  printf("%d\n", ans);
  return 0;
}
