#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return x * f;
}
const int N = 1e6 + 10, inf = 0x3f3f3f3f;
int head[N], ver[N], edge[N], nxt[N], tot = 1;
void add(int x, int y, int z) {
  ver[++tot] = y;
  edge[tot] = z;
  nxt[tot] = head[x];
  head[x] = tot;
}
int dep[N];
bool vis[N];
int S, T;
bool bfs() {
  memset(dep, 0x3f, sizeof(dep));
  memset(vis, 0, sizeof(vis));
  dep[S] = 0;
  queue<int> que;
  que.push(S);
  while (!que.empty()) {
    int x = que.front();
    que.pop();
    vis[x] = 0;
    for (int i = head[x]; i; i = nxt[i]) {
      int y = ver[i];
      if (dep[x] + 1 < dep[y] && edge[i]) {
        dep[y] = dep[x] + 1;
        if (!vis[y]) {
          vis[y] = 1;
          que.push(y);
        }
      }
    }
  }
  return dep[T] != inf;
}
int dfs(int x, int limit) {
  if (x == T || !limit) return limit;
  int flow = 0, rlow = 0;
  for (int i = head[x]; i; i = nxt[i]) {
    int y = ver[i];
    if (dep[y] == dep[x] + 1 && edge[i]) {
      if (rlow = dfs(y, min(limit, edge[i]))) {
        edge[i] -= rlow;
        edge[i ^ 1] += rlow;
        flow += rlow;
        limit -= rlow;
        if (!limit) break;
      }
    }
  }
  return flow;
}
int dinic() {
  int ans = 0;
  while (bfs()) ans += dfs(S, inf);
  return ans;
}
int x[N], dis[610][610], v, e, n, k;
bool check(int mid) {
  memset(head, 0, sizeof(head));
  tot = 1;
  for (int i = 1; i <= v; i++) add(i + v, T, 1), add(T, i + v, 0);
  for (int i = 1; i <= v; i++) {
    if (x[i]) add(S, i, x[i]), add(i, S, 0);
    for (int j = 1; j <= v; j++)
      if (dis[i][j] <= mid) add(i, j + v, inf), add(j + v, i, 0);
  }
  int ans = dinic();
  return ans >= k;
}
int main() {
  v = read(), e = read(), n = read(), k = read();
  S = 0;
  T = v * 2 + 2;
  for (int i = 1; i <= n; i++) x[read()]++;
  memset(dis, 0x3f, sizeof(dis));
  for (int i = 1; i <= v; i++) dis[i][i] = 0;
  for (int i = 1; i <= e; i++) {
    int x = read(), y = read(), z = read();
    dis[x][y] = dis[y][x] = min(dis[x][y], z);
  }
  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]);
  int l = 0, r = 1731311, ans = -1;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (check(mid))
      r = mid - 1, ans = mid;
    else
      l = mid + 1;
  }
  printf("%d", ans);
  return 0;
}
