#include <bits/stdc++.h>
const int INF = 0x3f3f3f3f;
int V, E, n, k;
int dis[605][605], pos[205];
int head[1005], nxt[1000005], ed, st, sd;
struct Edge {
  int u, v, cap;
  Edge() {}
  Edge(int u, int v, int cap) : u(u), v(v), cap(cap) {}
} e[1000005];
void AddEdge(int u, int v, int cap, int icap = 0) {
  nxt[ed] = head[u];
  head[u] = ed;
  e[ed++] = Edge(u, v, cap);
  nxt[ed] = head[v];
  head[v] = ed;
  e[ed++] = Edge(v, u, icap);
}
int dist[1005], cur[1005];
bool BFS() {
  static std::queue<int> que;
  static int now;
  memset(dist, -1, sizeof dist);
  dist[st] = 0;
  que.push(st);
  while (!que.empty()) {
    now = que.front();
    que.pop();
    for (int i = head[now]; ~i; i = nxt[i]) {
      if (!e[i].cap || dist[e[i].v] != -1) continue;
      dist[e[i].v] = dist[now] + 1;
      que.push(e[i].v);
    }
  }
  return dist[sd] != -1;
}
int DFS(int now, int maxflow) {
  if (now == sd || !maxflow) return maxflow;
  int res = 0, tmp;
  for (int &i = cur[now]; ~i; i = nxt[i]) {
    if (!e[i].cap || dist[e[i].v] != dist[now] + 1) continue;
    tmp = DFS(e[i].v, std::min(e[i].cap, maxflow));
    e[i].cap -= tmp;
    e[i ^ 1].cap += tmp;
    res += tmp;
    maxflow -= tmp;
    if (!maxflow) break;
  }
  if (!res) dist[now] = -1;
  return res;
}
int Dinic() {
  int res = 0;
  while (BFS()) {
    memcpy(cur, head, sizeof head);
    res += DFS(st, INF);
  }
  return res;
}
bool check(int mid) {
  memset(head, -1, sizeof head);
  ed = 0;
  st = 0, sd = V + n + 1;
  for (int i = 1; i <= n; ++i) AddEdge(st, i, 1);
  for (int i = 1; i <= V; ++i) AddEdge(n + i, sd, 1);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= V; ++j)
      if (dis[pos[i]][j] <= mid) AddEdge(i, n + j, 1);
  return Dinic() >= k;
}
void Floyd() {
  for (int t = 1; t <= V; ++t)
    for (int i = 1; i <= V; ++i)
      for (int j = i + 1; j <= V; ++j)
        dis[j][i] = dis[i][j] = std::min(dis[i][j], dis[i][t] + dis[t][j]);
}
int main() {
  memset(dis, 0x3f, sizeof dis);
  scanf("%d%d%d%d", &V, &E, &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", pos + i);
  for (int u, v, d; E--;) {
    scanf("%d%d%d", &u, &v, &d);
    dis[u][v] = dis[v][u] = std::min(dis[u][v], d);
  }
  for (int i = 1; i <= V; ++i) dis[i][i] = 0;
  Floyd();
  int ans = -1, l = 0, r = 1731311;
  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;
}
