#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3fffffff;
const int SINF = 0x7fffffff;
const long long LINF = 0x3fffffffffffffff;
const long long SLINF = 0x7fffffffffffffff;
const int MAXN = 607;
const int MAXV = 1507;
const int MAXM = 500007;
const int MAX = 1731400;
struct eT {
  void setd(int _u, int _v, int _f, int _l) {
    u = _u, v = _v, f = _f, last = _l;
  }
  int u, v, f, last;
} edge[MAXM];
int n, v, k;
int S = MAXV - 1, T = MAXV - 2;
int ke, la[MAXV];
int a[MAXN];
int dist[MAXN][MAXN];
int lev[MAXV], q[MAXV];
void init();
void input();
void work();
bool check(int tst);
void addedge(int u, int v, int fu, int fv);
int dinic();
bool bfs();
int dfs(int now, int lim);
int main() {
  init();
  input();
  work();
}
void init() { ios::sync_with_stdio(false); }
void input() {
  int m;
  scanf("%d%d%d%d", &v, &m, &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  int u, v, w;
  memset(dist, 0x3f3f3f3f, sizeof(dist));
  for (int i = 0; i < m; ++i) {
    scanf("%d%d%d", &u, &v, &w);
    dist[u][v] = (((dist[u][v]) < (w)) ? (dist[u][v]) : (w));
    dist[v][u] = (((dist[v][u]) < (w)) ? (dist[v][u]) : (w));
  }
}
void work() {
  for (int i = 1; i <= v; ++i) dist[i][i] = 0;
  for (int k = 1; k <= v; ++k)
    for (int i = 1; i <= v; ++i)
      for (int j = 1; j <= v; ++j)
        dist[i][j] = (((dist[i][j]) < (dist[i][k] + dist[k][j]))
                          ? (dist[i][j])
                          : (dist[i][k] + dist[k][j]));
  int l = 0, r = MAX, mid;
  while (l < r) {
    mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", (l <= 1731311) ? l : -1);
}
bool check(int tst) {
  ke = 0;
  memset(la, -1, sizeof(la));
  for (int i = 1; i <= n; ++i) addedge(S, ((i) << 1), 1, 0);
  for (int i = 1; i <= v; ++i) addedge(((i) << 1 | 1), T, 1, 0);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= v; ++j) {
      if (dist[a[i]][j] <= tst) addedge(((i) << 1), ((j) << 1 | 1), 1, 0);
    }
  }
  return dinic() >= k;
}
void addedge(int u, int v, int fu, int fv) {
  edge[ke].setd(u, v, fu, la[u]);
  la[u] = ke++;
  edge[ke].setd(v, u, fv, la[v]);
  la[v] = ke++;
}
int dinic() {
  int ans = 0;
  while (bfs()) ans += dfs(S, INF);
  return ans;
}
bool bfs() {
  int l = 0, r = 0, now, v;
  q[r++] = S;
  memset(lev, -1, sizeof(lev));
  lev[S] = 1;
  while (l < r) {
    now = q[l++];
    for (int i = la[now]; ~i; i = edge[i].last) {
      if (edge[i].f && lev[v = edge[i].v] == -1) {
        q[r++] = v;
        lev[v] = lev[now] + 1;
      }
    }
  }
  return (lev[T] != -1);
}
int dfs(int now, int lim) {
  if (now == T) return lim;
  int cf, rf = lim, v;
  for (int i = la[now]; ~i; i = edge[i].last) {
    if (edge[i].f && lev[v = edge[i].v] == lev[now] + 1) {
      cf = dfs(v, (((rf) < (edge[i].f)) ? (rf) : (edge[i].f)));
      rf -= cf;
      edge[i].f -= cf, edge[i ^ 1].f += cf;
      if (!rf) break;
    }
  }
  if (rf == lim) lev[now] = -1;
  return lim - rf;
}
