#include <bits/stdc++.h>
using namespace std;
const int inf = 2e8 + 1, maxs = 1731311;
int v, e, n, k;
int st[200], a, b, t;
vector<pair<int, int> > x[600];
int dist[600][600];
set<pair<int, int> > s;
pair<int, int> c;
int lo, hi, mid;
bool bio[200];
int m[600], p;
int f(int y) {
  if (bio[y]) return 0;
  bio[y] = true;
  for (int i = 0; i < v; i++) {
    if (dist[st[y]][i] <= mid && (m[i] == -1 || f(m[i]))) {
      m[i] = y;
      return 1;
    }
  }
  return 0;
}
int main() {
  cin >> v >> e >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> st[i];
    st[i]--;
  }
  for (int i = 0; i < v; i++) x[i].push_back(make_pair(0, i));
  for (int i = 0; i < e; i++) {
    cin >> a >> b >> t;
    a--;
    b--;
    x[a].push_back(make_pair(t, b));
    x[b].push_back(make_pair(t, a));
  }
  for (int i = 0; i < v; i++) {
    for (int j = 0; j < v; j++) {
      if (i == j)
        dist[i][j] = 0;
      else
        dist[i][j] = inf;
    }
    s.insert(make_pair(0, i));
    while (!s.empty()) {
      c = *s.begin();
      s.erase(c);
      for (int j = 1; j < x[c.second].size(); j++) {
        if (dist[i][x[c.second][j].second] >
            dist[i][c.second] + x[c.second][j].first) {
          s.erase(
              make_pair(dist[i][x[c.second][j].second], x[c.second][j].second));
          dist[i][x[c.second][j].second] =
              dist[i][c.second] + x[c.second][j].first;
          s.insert(
              make_pair(dist[i][x[c.second][j].second], x[c.second][j].second));
        }
      }
    }
  }
  lo = 0;
  hi = maxs + 1;
  while (lo < hi) {
    mid = (lo + hi) / 2;
    for (int i = 0; i < v; i++) m[i] = -1;
    p = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) bio[j] = false;
      p += f(i);
    }
    if (p >= k)
      hi = mid;
    else
      lo = mid + 1;
  }
  if (lo <= maxs)
    cout << lo;
  else
    cout << -1;
  return 0;
}
