#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
int p[maxn];
int dis[maxn][maxn];
void floyd(int v) {
  for (int i = 0; i <= v; i++) dis[i][i] = 0;
  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][k] + dis[k][j], dis[i][j]);
      }
    }
  }
}
int pre[maxn], vis[maxn];
int g[maxn][maxn];
int dfs(int u, int v) {
  for (int i = 1; i <= v; i++) {
    if (g[u][i] && !vis[i]) {
      vis[i] = 1;
      if (pre[i] == -1 || dfs(pre[i], v)) {
        pre[i] = u;
        return 1;
      }
    }
  }
  return 0;
}
int hungry(int n, int v) {
  int ans = 0;
  memset(pre, -1, sizeof pre);
  for (int i = 0; i < n; i++) {
    memset(vis, 0, sizeof(vis));
    if (dfs(i, v)) ans++;
  }
  return ans;
}
int main() {
  memset(dis, 0x3f, sizeof dis);
  int v, e, n, m;
  scanf("%d%d%d%d", &v, &e, &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", &p[i]);
  for (int i = 0; i < e; i++) {
    int a, b, w;
    scanf("%d%d%d", &a, &b, &w);
    dis[a][b] = dis[b][a] = min(dis[b][a], w);
  }
  floyd(v);
  int l = 0, r = 2e6;
  while (l < r) {
    int mid = (l + r) / 2;
    memset(g, 0, sizeof g);
    for (int i = 0; i < n; i++) {
      for (int j = 1; j <= v; j++) {
        if (dis[p[i]][j] <= mid) g[i][j] = 1;
      }
    }
    int rec = hungry(n, v);
    if (rec >= m)
      r = mid;
    else
      l = mid + 1;
  }
  cout << (r == 2e6 ? -1 : r) << endl;
}
