#include <bits/stdc++.h>
using namespace std;
const int maxn = 700;
int V, E, N, K, mark[maxn], mark1[maxn], city[maxn], C[maxn][maxn], match[maxn];
vector<int> G[maxn];
bool khun(int nodo) {
  if (mark1[nodo]) return false;
  mark1[nodo] = 1;
  for (auto i : G[nodo]) {
    if (match[i] == -1 || khun(match[i])) {
      match[i] = nodo;
      return true;
    }
  }
  return false;
}
bool can(int t) {
  for (int i = 1; i <= V; i++) G[i].clear(), match[i] = -1;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= V; j++) {
      if (C[city[i]][j] <= t) G[i].push_back(j);
    }
  }
  int sol = 0;
  for (int i = 1; i <= N; i++) {
    for (int i = 1; i <= V; i++) mark1[i] = 0;
    sol += khun(i);
  }
  return sol >= K;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> V >> E >> N >> K;
  for (int i = 1; i <= N; i++) cin >> city[i];
  for (int i = 1; i <= V; i++)
    for (int j = 1; j <= V; j++) C[i][j] = 1 << 30;
  for (int i = 1; i <= V; i++) C[i][i] = 0;
  int a, b, c;
  for (int i = 1; i <= E; i++) {
    cin >> a >> b >> c;
    C[a][b] = min(C[a][b], c);
    C[b][a] = min(C[b][a], c);
  }
  for (int k = 1; k <= V; k++)
    for (int i = 1; i <= V; i++)
      for (int j = 1; j <= V; j++)
        if (C[i][k] != 1 << 30 && C[k][j] != 1 << 30)
          C[i][j] = min(C[i][j], C[i][k] + C[k][j]);
  int ini = 0, fin = 1731311, sol = 1 << 30;
  while (ini <= fin) {
    int mit = (ini + fin) / 2;
    if (can(mit))
      sol = mit, fin = mit - 1;
    else
      ini = mit + 1;
  }
  if (sol < 1 << 30)
    cout << sol;
  else
    cout << "-1";
  return 0;
}
