#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1205;
struct Graph {
  int to, cap, next;
} e[MAX_N << 8];
int fir[MAX_N], e_cnt;
void clearGraph() {
  memset(fir, -1, sizeof(fir));
  e_cnt = 0;
}
void Add_Edge(int u, int v, int c) {
  e[e_cnt] = (Graph){v, c, fir[u]}, fir[u] = e_cnt++;
  e[e_cnt] = (Graph){u, 0, fir[v]}, fir[v] = e_cnt++;
}
int dis[MAX_N][MAX_N];
int V, M, N, K, c[MAX_N];
int level[MAX_N];
bool bfs(int s, int t) {
  queue<int> que;
  for (int i = 0; i <= (V << 1 | 1); i++) level[i] = -1;
  level[s] = 0, que.push(s);
  while (!que.empty()) {
    int x = que.front();
    que.pop();
    for (int i = fir[x]; ~i; i = e[i].next) {
      int v = e[i].to;
      if (!e[i].cap || ~level[v]) continue;
      level[v] = level[x] + 1, que.push(v);
    }
  }
  return level[t] != -1;
}
int iter[MAX_N];
int dfs(int x, int t, int f) {
  if (x == t) return f;
  for (int &i = iter[x]; ~i; i = e[i].next) {
    int v = e[i].to;
    if (e[i].cap && level[v] > level[x]) {
      int d = dfs(v, t, min(f, e[i].cap));
      if (d) {
        e[i].cap -= d;
        e[i ^ 1].cap += d;
        return d;
      }
    }
  }
  level[x] = -1;
  return 0;
}
int dinic(int s, int t) {
  int res = 0;
  while (bfs(s, t)) {
    for (int i = 0; i <= (V << 1 | 1); i++) iter[i] = fir[i];
    int f;
    while ((f = dfs(s, t, 1e9))) res += f;
  }
  return res;
}
bool check(int mid) {
  clearGraph();
  int s = 0, t = V << 1 | 1;
  for (int i = 1; i <= N; i++) Add_Edge(s, c[i] + V, 1);
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= V; j++)
      if (dis[c[i]][j] <= mid) Add_Edge(c[i] + V, j, 1);
  for (int i = 1; i <= V; i++) Add_Edge(i, t, 1);
  return dinic(s, t) >= K;
}
int main() {
  scanf("%d %d %d %d", &V, &M, &N, &K);
  for (int i = 1; i <= N; i++) scanf("%d", c + i);
  for (int i = 1; i <= V; i++)
    for (int j = 1; j <= V; j++) dis[i][j] = 1e9;
  for (int i = 1; i <= V; i++) dis[i][i] = 0;
  for (int i = 1; i <= M; i++) {
    int u, v, w;
    scanf("%d %d %d", &u, &v, &w);
    dis[u][v] = dis[v][u] = min(dis[u][v], w);
  }
  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 = 1731311;
  if (!check(r)) return puts("-1") & 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  printf("%d\n", ans);
  return 0;
}
