#include <bits/stdc++.h>
using namespace std;
function<void(void)> ____ = []() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
};
const int MAXN = 1111;
const int INF = 0x3f3f3f3f;
int n, m, num, ff, cnt[MAXN], ID[MAXN], g[MAXN][MAXN];
void floyd() {
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = i + 1; j <= n; j++)
        g[i][j] = g[j][i] = min(g[i][j], g[i][k] + g[k][j]);
}
struct EDGE {
  int to, cap, rev;
  EDGE(){};
  EDGE(int to, int cap, int rev) : to(to), cap(cap), rev(rev){};
};
vector<EDGE> G[MAXN];
int iter[MAXN], rk[MAXN];
void ADDEDGE(int u, int v, int cap) {
  G[u].push_back(EDGE(v, cap, (int)G[v].size()));
  G[v].push_back(EDGE(u, 0, (int)G[u].size() - 1));
}
bool bfs() {
  memset(rk, 0, sizeof(rk));
  memset(iter, 0, sizeof(iter));
  rk[0] = 1;
  queue<int> que;
  que.push(0);
  while (!que.empty()) {
    int u = que.front();
    que.pop();
    for (auto e : G[u]) {
      if (!e.cap or rk[e.to]) continue;
      rk[e.to] = rk[u] + 1;
      que.push(e.to);
    }
  }
  return rk[MAXN - 1] != 0;
}
int dfs(int u, int flow) {
  if (u == MAXN - 1) return flow;
  for (int &i = iter[u]; i < (int)G[u].size(); i++) {
    auto &e = G[u][i];
    if (!e.cap or rk[e.to] != rk[u] + 1) continue;
    int d = dfs(e.to, min(e.cap, flow));
    if (d) {
      e.cap -= d;
      G[e.to][e.rev].cap += d;
      return d;
    }
  }
  return 0;
}
int Dinic() {
  int flow = 0;
  while (bfs()) {
    int d = dfs(0, INF);
    while (d) {
      flow += d;
      d = dfs(0, INF);
    }
  }
  return flow;
}
bool check(int mid) {
  for (int i = 0; i < MAXN; i++) G[i].clear();
  for (int i = 1; i <= n; i++) ADDEDGE(i, MAXN - 1, 1);
  for (int i = 1; i <= n; i++) {
    if (!cnt[i]) continue;
    ADDEDGE(0, ID[i], cnt[i]);
    for (int j = 1; j <= n; j++)
      if (g[i][j] <= mid) ADDEDGE(ID[i], j, 1);
  }
  return Dinic() >= ff;
}
int main() {
  ____();
  cin >> n >> m >> num >> ff;
  for (int i = 1; i <= num; i++) {
    int p;
    cin >> p;
    cnt[p]++;
  }
  memset(g, 0x3f, sizeof(g));
  for (int i = 1; i <= m; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    g[u][v] = g[v][u] = min(g[u][v], w);
  }
  for (int i = 1; i <= n; i++) g[i][i] = 0;
  floyd();
  int id = n;
  for (int i = 1; i <= n; i++)
    if (cnt[i]) ID[i] = ++id;
  int l = 0, r = 1731311;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  if (l == 1731312)
    cout << -1 << endl;
  else
    cout << l << endl;
  return 0;
}
