#include <bits/stdc++.h>
using namespace std;
const int N = 605;
int V, e, n, K, x[N], dis[N][N];
int vis[N], mch[N];
vector<int> G[N];
int dfs(int u, int s) {
  if (vis[u] == s) return 0;
  vis[u] = s;
  for (int v : G[u])
    if (!mch[v] || dfs(mch[v], s)) return mch[v] = u, 1;
  return 0;
}
int chk(int mid, int res = 0) {
  for (int i = (1); i <= (n); i++) {
    G[i].clear();
    for (int j = (1); j <= (V); j++)
      if (dis[x[i]][j] <= mid) G[i].push_back(j);
  }
  memset(vis, 0, sizeof vis), memset(mch, 0, sizeof mch);
  for (int i = (1); i <= (n); i++)
    if ((res += dfs(i, i)) == K) return 1;
  return 0;
}
int main() {
  memset(dis, 63, sizeof dis);
  cin >> V >> e >> n >> K;
  for (int i = (1); i <= (n); i++) scanf("%d", &x[i]);
  for (int i = (1); i <= (V); i++) dis[i][i] = 0;
  for (int u, v, w; e--; scanf("%d%d%d", &u, &v, &w),
                         (dis[u][v] = min(dis[u][v], w)),
                         (dis[v][u] = min(dis[v][u], 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]));
  if (!chk(0x3f3f3f3f - 1)) puts("-1"), exit(0);
  int l = 0, r = 1731311, mid;
  while (l <= r) {
    mid = (l + r) / 2;
    if (chk(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  cout << l;
  return 0;
}
