#include <bits/stdc++.h>
using namespace std;
const int N = 610;
const int M = 2e4 + 5;
int dis[N][N], V, E, n, k, ans;
bool avail[N][N], vis[N], v[N];
int tot, head[M], ver[M << 1], nxt[M << 1], edge[M << 1], st[N], match[N];
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;
}
void add(int x, int y, int z) {
  tot++;
  ver[tot] = y;
  edge[tot] = z;
  nxt[tot] = head[x];
  head[x] = tot;
}
void Dij(int s) {
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      q;
  q.push(make_pair(0, s));
  while (!q.empty()) {
    int x = q.top().second;
    int curd = q.top().first;
    q.pop();
    if (dis[s][x] < curd) continue;
    dis[s][x] = curd;
    for (int i = head[x]; i; i = nxt[i]) {
      int y = ver[i];
      if (curd + edge[i] < dis[s][y]) {
        dis[s][y] = curd + edge[i];
        q.push(make_pair(dis[s][y], y));
      }
    }
  }
}
bool BiMatch(int x) {
  for (int i = 1; i <= V; i++) {
    if (vis[i] || !avail[x][i]) continue;
    vis[i] = 1;
    if (match[i] == -1 || BiMatch(match[i])) {
      match[i] = x;
      return 1;
    }
  }
  return 0;
}
int check(int x) {
  memset(match, -1, sizeof(match));
  memset(avail, 0, sizeof(avail));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= V; j++)
      if (dis[st[i]][j] <= x) avail[i][j] = dis[st[i]][j] <= x;
  int res = 0;
  for (int i = 1; i <= n; i++) {
    memset(vis, false, sizeof(vis));
    if (BiMatch(i)) res++;
  }
  return res;
}
int main() {
  V = read(), E = read(), n = read(), k = read();
  for (int i = 1; i <= n; i++) st[i] = read();
  for (int i = 1; i <= E; i++) {
    int x = read(), y = read(), z = read();
    add(x, y, z);
    add(y, x, z);
  }
  memset(dis, 0x3f3f3f3f, sizeof(dis));
  for (int i = 1; i <= n; i++)
    if (!vis[st[i]]) vis[st[i]] = true, Dij(st[i]);
  int l = 0, r = 1731312, mid;
  ans = 1731312;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid) >= k)
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  if (ans == 1731312) puts("-1"), exit(0);
  cout << ans << endl;
  return 0;
}
