#include <bits/stdc++.h>
using namespace std;
const int N = 610;
const int M = 200010;
const int M2 = 1000010;
const int MX = 1731311;
int S, T;
struct Dinic {
  struct edge {
    int v, nxt, cap, flow;
  } E[M2];
  int tot = 1;
  int head[M], dis1[M], cur[M];
  queue<int> q;
  void add(int u, int v, int cap, int flow) {
    E[++tot].v = v;
    E[tot].cap = cap;
    E[tot].flow = flow;
    E[tot].nxt = head[u];
    head[u] = tot;
    return;
  }
  void ADD(int u, int v, int cap) {
    add(u, v, cap, 0);
    add(v, u, 0, 0);
    return;
  }
  bool BFS() {
    memset(dis1, 0, sizeof(dis1));
    dis1[S] = 1;
    q.push(S);
    while (!q.empty()) {
      int u = q.front();
      q.pop();
      for (int i = head[u]; i; i = E[i].nxt) {
        int v = E[i].v, c = E[i].cap, f = E[i].flow;
        if (!dis1[v] && c > f) {
          dis1[v] = dis1[u] + 1;
          q.push(v);
        }
      }
    }
    return dis1[T];
  }
  int DFS(int x, int flow) {
    if (x == T) return flow;
    int fl = 0;
    for (int i = cur[x]; i; i = E[i].nxt) {
      cur[x] = i;
      int v = E[i].v, c = E[i].cap, f = E[i].flow;
      if (dis1[x] + 1 == dis1[v] && c > f) {
        int k = DFS(v, min(flow, c - f));
        if (k) {
          E[i].flow += k;
          E[i ^ 1].flow -= k;
          flow -= k;
          fl += k;
          if (!flow) break;
        }
      }
    }
    if (!fl)
      return dis1[x] = 0;
    else
      return fl;
  }
  int dinic() {
    int flow = 0;
    while (BFS()) {
      memcpy(cur, head, sizeof(head));
      int tmp;
      while (tmp = DFS(S, 1e9)) flow += tmp;
    }
    return flow;
  }
  void Memset() {
    memset(head, -1, sizeof(head));
    tot = 1;
  }
} A;
int V, n, e, K, u, v, w, tmp;
int X[N];
int dis[N][N];
void FLOYD() {
  for (int k = 1; k <= V; k++)
    for (int i = 1; i <= V; i++)
      for (int j = 1; j <= V; j++)
        dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j]);
  return;
}
bool check(int x) {
  A.Memset();
  for (int i = 1; i <= V; i++) A.ADD(i + V, T, 1);
  for (int i = 1; i <= V; i++) {
    if (X[i]) A.ADD(S, i, X[i]);
    for (int j = 1; j <= V; j++)
      if (dis[i][j] <= x) A.ADD(i, j + V, 1e9);
  }
  return A.dinic() >= K;
}
int main() {
  memset(dis, 0x3f, sizeof(dis));
  scanf("%d%d%d%d", &V, &e, &n, &K);
  S = 0;
  T = V * 2 + 2;
  for (int i = 1; i <= n; i++) scanf("%d", &tmp), X[tmp]++;
  for (int i = 1; i <= V; i++) dis[i][i] = 0;
  for (int i = 1; i <= e; i++) {
    scanf("%d%d%d", &u, &v, &w);
    dis[u][v] = dis[v][u] = min(dis[u][v], w);
  }
  FLOYD();
  int l = 0, r = MX, ans = -1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1, ans = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", ans);
  return 0;
}
