#include <bits/stdc++.h>
using namespace std;
int dist[605][605], u, v, a[205], n, Vv, E, m, fix[605], match[605], w, ans, l,
    r, k;
priority_queue<pair<int, int>, vector<pair<int, int> >,
               greater<pair<int, int> > >
    q;
vector<pair<int, int> > V[605];
vector<pair<pair<int, int>, int> > ed;
void dijkstra(int cur) {
  for (int i = 1; i <= Vv; i++) dist[cur][i] = 1e7;
  q.push({0, cur});
  dist[cur][cur] = 0;
  while (q.size()) {
    u = q.top().second;
    int d = q.top().first;
    q.pop();
    if (d > dist[cur][u]) continue;
    for (int i = 0; i < V[u].size(); i++) {
      v = V[u][i].first;
      if (dist[cur][v] > dist[cur][u] + V[u][i].second) {
        dist[cur][v] = dist[cur][u] + V[u][i].second;
        q.push({dist[cur][v], v});
      }
    }
  }
}
bool dfs(int u, int T) {
  for (int v = 1; v <= Vv; v++) {
    if (!fix[v] && dist[u][v] <= T) {
      fix[v] = 1;
      if (match[v] == -1 || dfs(match[v], T)) {
        match[v] = u;
        return true;
      }
    }
  }
  return false;
}
bool check(int T) {
  int pas = 0;
  for (k = 1; k <= Vv; k++) {
    match[k] = -1;
  }
  for (k = 1; k <= n; k++) {
    for (int i = 1; i <= Vv; i++) fix[i] = 0;
    if (dfs(a[k], T)) pas++;
  }
  if (pas >= m) return true;
  return false;
}
int main() {
  cin >> Vv >> E >> n >> m;
  for (k = 1; k <= n; k++) {
    cin >> a[k];
  }
  for (k = 1; k <= E; k++) {
    cin >> u >> v >> w;
    ed.push_back({{u, v}, w});
    V[u].push_back({v, w});
    V[v].push_back({u, w});
  }
  for (k = 1; k <= n; k++) {
    dijkstra(a[k]);
  }
  l = 0;
  r = 1731311;
  ans = -1;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (check(mid)) {
      ans = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  cout << ans << endl;
}
