#include <bits/stdc++.h>
using namespace std;
const int N = 605, M = 1e9 + 7;
int v, e, n, k, st[N], matchR[N];
vector<vector<pair<int, int>>> g;
vector<vector<int>> nw;
bool seen[N];
int cost[N][N];
void graph(int mid) {
  nw.clear();
  nw.resize(v);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < v; j++) {
      if (cost[st[i]][j] <= mid) nw[i].push_back(j);
    }
}
void dijk(int u) {
  priority_queue<pair<int, int>> q;
  q.push({0, u});
  while (q.size()) {
    int c = -q.top().first, no = q.top().second;
    q.pop();
    if (cost[u][no] < c) continue;
    for (int i = 0; i < g[no].size(); i++) {
      int x = g[no][i].first, y = g[no][i].second;
      if (cost[u][no] + y < cost[u][x]) {
        cost[u][x] = cost[u][no] + y;
        q.push({-cost[u][x], x});
      }
    }
  }
}
bool bpm(int u) {
  for (int i = 0; i < nw[u].size(); i++) {
    int x = nw[u][i];
    if (!seen[x]) {
      seen[x] = true;
      if (matchR[x] < 0 || bpm(matchR[x])) {
        matchR[x] = u;
        return true;
      }
    }
  }
  return false;
}
int maxBPM() {
  memset(matchR, -1, sizeof(matchR));
  int result = 0;
  for (int i = 0; i < n; i++) {
    memset(seen, 0, sizeof(seen));
    if (bpm(i)) result++;
  }
  return result >= k;
}
int main() {
  scanf("%d%d%d%d", &v, &e, &n, &k);
  g.resize(v);
  for (int i = 0; i < n; i++) {
    scanf("%d", &st[i]);
    st[i]--;
  }
  for (int a, b, c, i = 0; i < e; i++) {
    scanf("%d%d%d", &a, &b, &c);
    a--, b--;
    g[a].push_back({b, c});
    g[b].push_back({a, c});
  }
  for (int i = 0; i < v; ++i)
    for (int j = 0; j < v; ++j) {
      if (i == j) continue;
      cost[i][j] = 1e9;
    }
  for (int i = 0; i < v; i++) dijk(i);
  int l = 0, r = 1731311, mid, best = -1;
  while (l <= r) {
    mid = (l + r) / 2;
    graph(mid);
    if (maxBPM()) {
      best = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  cout << best << endl;
  return 0;
}
