#include <bits/stdc++.h>
using namespace std;
const int MAXN = 605, mod = 1e9 + 7;
int ilu[MAXN], dist[MAXN][MAXN], n;
vector<int> sas[2 * MAXN];
int fl[2 * MAXN][2 * MAXN];
bool byl[2 * MAXN];
bool wal(int co) {
  byl[co] = 1;
  if (co == MAXN + n + 2) return 1;
  for (auto x : sas[co])
    if (!byl[x] && fl[co][x] && wal(x)) {
      fl[co][x]--;
      fl[x][co]++;
      return 1;
    }
  return 0;
}
int match(int cap) {
  int a, b, c, d, w = 0, zr = MAXN + n + 1, uj = MAXN + n + 2;
  for (a = 0; a < 2 * MAXN; a++) {
    byl[a] = 0;
    sas[a].clear();
    for (b = 0; b < 2 * MAXN; b++) fl[a][b] = 0;
  }
  c = 1;
  for (a = 1; a <= n; a++) {
    sas[MAXN + a].push_back(uj);
    fl[MAXN + a][uj] = 1;
    for (b = ilu[a]; b; b--) {
      sas[zr].push_back(c);
      sas[c].push_back(zr);
      fl[zr][c] = 1;
      for (d = 1; d <= n; d++)
        if (dist[a][d] <= cap) {
          sas[c].push_back(MAXN + d);
          sas[MAXN + d].push_back(c);
          fl[c][MAXN + d] = 1;
        }
      c++;
    }
  }
  while (wal(zr)) {
    for (a = 0; a < 2 * MAXN; a++) byl[a] = 0;
    w++;
  }
  return w;
}
int main() {
  int a, b, c, d, e, f, k, q, m, l, p, s, chce;
  scanf("%d%d%d%d", &n, &m, &l, &chce);
  for (a = 1; a <= n; a++) {
    for (b = 1; b <= n; b++) dist[a][b] = 10000000;
    dist[a][a] = 0;
  }
  for (a = 1; a <= l; a++) {
    scanf("%d", &b);
    ilu[b]++;
  }
  while (m--) {
    scanf("%d%d%d", &a, &b, &c);
    dist[a][b] = min(dist[a][b], c);
    dist[b][a] = dist[a][b];
  }
  for (a = 1; a <= n; a++)
    for (b = 1; b <= n; b++)
      for (c = 1; c <= n; c++)
        dist[b][c] = min(dist[b][c], dist[b][a] + dist[a][c]);
  p = 0;
  k = 1731312;
  while (p != k) {
    s = (p + k) / 2;
    if (match(s) >= chce)
      k = s;
    else
      p = s + 1;
  }
  if (p == 1731312)
    printf("-1");
  else
    printf("%d", p);
  return 0;
}
