#include <bits/stdc++.h>
using namespace std;
struct Dinic {
  int nodes, src, dst;
  vector<int> dist, q, work;
  struct edge {
    int to, rev;
    long long f, cap;
  };
  vector<vector<edge>> g;
  Dinic(int x) : nodes(x), g(x), dist(x), q(x), work(x) {}
  void add_edge(int s, int t, long long cap) {
    g[s].push_back((edge){t, ((int)g[t].size()), 0, cap});
    g[t].push_back((edge){s, ((int)g[s].size()) - 1, 0, 0});
  }
  bool dinic_bfs() {
    fill(dist.begin(), dist.end(), -1);
    dist[src] = 0;
    int qt = 0;
    q[qt++] = src;
    for (int qh = 0; qh < qt; qh++) {
      int u = q[qh];
      for (int i = 0; i < ((int)g[u].size()); i++) {
        edge &e = g[u][i];
        int v = g[u][i].to;
        if (dist[v] < 0 && e.f < e.cap) dist[v] = dist[u] + 1, q[qt++] = v;
      }
    }
    return dist[dst] >= 0;
  }
  long long dinic_dfs(int u, long long f) {
    if (u == dst) return f;
    for (int &i = work[u]; i < ((int)g[u].size()); i++) {
      edge &e = g[u][i];
      if (e.cap <= e.f) continue;
      int v = e.to;
      if (dist[v] == dist[u] + 1) {
        long long df = dinic_dfs(v, min(f, e.cap - e.f));
        if (df > 0) {
          e.f += df;
          g[v][e.rev].f -= df;
          return df;
        }
      }
    }
    return 0;
  }
  long long max_flow(int _src, int _dst) {
    src = _src;
    dst = _dst;
    long long result = 0;
    while (dinic_bfs()) {
      fill(work.begin(), work.end(), 0);
      while (long long delta = dinic_dfs(src, 1e9)) result += delta;
    }
    return result;
  }
};
const int N = 800;
int c[N][N];
void floyd(int n) {
  for (int k = 0; k < n; k++)
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) c[i][j] = min(c[i][j], c[i][k] + c[k][j]);
}
int main() {
  int v, e, n, k;
  cin >> v >> e >> n >> k;
  int a[v];
  memset(a, 0, sizeof(a));
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a[x - 1]++;
  }
  for (int i = 0; i < v; i++)
    for (int j = 0; j < v; j++)
      if (i != j) c[i][j] = 1e9;
  for (int i = 0; i < e; i++) {
    int a, b, t;
    cin >> a >> b >> t;
    a--, b--;
    c[a][b] = c[b][a] = min(c[a][b], t);
  }
  floyd(v);
  int izq = 0, der = 2000000;
  long long res = -1;
  while (izq <= der) {
    int med = (izq + der) / 2;
    int M = 2 * N;
    Dinic d(M + 2);
    for (int i = 0; i < v; i++) {
      d.add_edge(M, i, 1);
      for (int j = 0; j < v; j++)
        if (c[i][j] <= med) {
          d.add_edge(i, j + v, 1e9);
        }
      d.add_edge(i + v, M + 1, a[i]);
    }
    if (d.max_flow(M, M + 1) >= k)
      der = med - 1, res = med;
    else
      izq = med + 1;
  }
  cout << res << endl;
  return 0;
}
