#include <bits/stdc++.h>
using namespace std;
const int V = 808, E = 250000;
int start[V];
int succ[E], cap[E], to[E];
int edge_counter = 0;
void add_edge(int u, int v, int c) {
  cap[edge_counter] = c, to[edge_counter] = v;
  succ[edge_counter] = start[u];
  start[u] = edge_counter;
  ++edge_counter;
}
int inv(int e) { return e ^ 1; }
int n, s, t;
int lvl[V];
int nextchld[V];
bool bfs() {
  for (int i = 0; i < n; i++) lvl[i] = -1;
  queue<int> q;
  q.push(s);
  lvl[s] = 0;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    nextchld[u] = start[u];
    for (int e = start[u]; ~e; e = succ[e]) {
      if (cap[e] > 0) {
        int nxt = to[e];
        if (lvl[nxt] != -1) continue;
        lvl[nxt] = lvl[u] + 1;
        q.push(nxt);
      }
    }
  }
  return lvl[t] != -1;
}
int aug(int u, int cflow) {
  if (u == t) return cflow;
  for (int &i = nextchld[u]; i >= 0; i = succ[i]) {
    if (cap[i] > 0) {
      int nxt = to[i];
      if (lvl[nxt] != lvl[u] + 1) continue;
      int rf = aug(nxt, min(cflow, cap[i]));
      if (rf > 0) {
        cap[i] -= rf;
        cap[i ^ 1] += rf;
        return rf;
      }
    }
  }
  lvl[u] = -1;
  return 0;
}
int mf() {
  int tot = 0;
  while (bfs())
    for (int x = aug(s, 1); x; x = aug(s, 1)) tot += x;
  return tot;
}
const int INF = 1000 * 1000 * 1000 + 7;
const int NT = 220;
const int NC = 660;
int sc[NT];
int d[NC][NC];
int bsearch(int nt, int nc, int k) {
  int lo = 0;
  int hi = 1731311;
  int bestSoFar = -1;
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    fill(start, start + V, -1);
    edge_counter = 0;
    for (int i = 0; i < nt; i++) {
      add_edge(s, i, 1);
      add_edge(i, s, 0);
    }
    for (int i = 0; i < nc; i++) {
      add_edge(nt + i, t, 1);
      add_edge(t, nt + i, 0);
    }
    for (int i = 0; i < nt; i++)
      for (int j = 0; j < nc; j++)
        if (d[sc[i]][j] <= mid) {
          add_edge(i, nt + j, 1);
          add_edge(nt + j, i, 0);
        }
    int max_flow = mf();
    if (max_flow >= k) {
      bestSoFar = mid;
      hi = mid - 1;
    } else {
      lo = mid + 1;
    }
  }
  return bestSoFar;
}
int main(void) {
  int nc, e, nt, k;
  cin >> nc >> e >> nt >> k;
  n = nt + nc + 2;
  s = nt + nc;
  t = nt + nc + 1;
  for (int i = 0; i < nt; i++) {
    cin >> sc[i];
    sc[i]--;
  }
  for (int i = 0; i < nc; i++)
    for (int j = 0; j < nc; j++) d[i][j] = (i == j ? 0 : INF);
  for (int i = 0; i < e; i++) {
    int a, b, z;
    cin >> a >> b >> z;
    a--;
    b--;
    d[a][b] = min(d[a][b], z);
    d[b][a] = min(d[b][a], z);
  }
  for (int k = 0; k < nc; k++)
    for (int i = 0; i < nc; i++)
      for (int j = 0; j < nc; j++) d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
  cout << bsearch(nt, nc, k) << '\n';
}
