#include <bits/stdc++.h>
using namespace std;
const int N = 805;
const int INF = 0x7f7f7f7f;
int n, m, k, lim;
struct Edge {
  int from, to, cap, flow;
};
struct Dinic {
  int n, m, s, t;
  vector<Edge> Edges;
  vector<int> g[N];
  bool vis[N];
  int d[N], cur[N];
  void init(int n) {
    this->n = n;
    for (int i = 1; i <= n; i++) g[i].clear();
    Edges.clear();
  }
  void addEdge(int u, int v, int c) {
    Edges.push_back((Edge){u, v, c, 0});
    Edges.push_back((Edge){v, u, 0, 0});
    m = Edges.size();
    g[u].push_back(m - 2);
    g[v].push_back(m - 1);
  }
  bool bfs() {
    queue<int> Q;
    for (int i = 1; i <= n; i++) vis[i] = 0;
    d[s] = 0;
    vis[s] = 1;
    Q.push(s);
    while (!Q.empty()) {
      int u = Q.front();
      Q.pop();
      for (auto &x : g[u]) {
        Edge &e = Edges[x];
        if (!vis[e.to] && e.cap > e.flow) {
          vis[e.to] = 1;
          d[e.to] = d[u] + 1;
          Q.push(e.to);
        }
      }
    }
    return vis[t];
  }
  int dfs(int u, int a) {
    if (u == t || a == 0) return a;
    int ret = 0, f;
    for (int &i = cur[u]; i < g[u].size(); i++) {
      Edge &e = Edges[g[u][i]];
      if (d[u] + 1 == d[e.to] && (f = dfs(e.to, min(a, e.cap - e.flow))) > 0) {
        e.flow += f;
        Edges[g[u][i] ^ 1].flow -= f;
        ret += f;
        a -= f;
        if (a == 0) break;
      }
    }
    return ret;
  }
  int maxflow(int s, int t) {
    this->s = s;
    this->t = t;
    int ret = 0;
    while (bfs()) {
      for (int i = 1; i <= n; i++) cur[i] = 0;
      ret += dfs(s, INF);
    }
    return ret;
  }
} T;
bool done[N];
vector<pair<int, int> > g[N];
int dis[N][N], st[N];
void dij(int s) {
  memset(dis[s], 0x3f, sizeof(dis[s]));
  memset(done, 0, sizeof(done));
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      Q;
  Q.push(make_pair(0, s));
  dis[s][s] = 0;
  while (!Q.empty()) {
    int u = Q.top().second;
    Q.pop();
    if (done[u]) continue;
    done[u] = 1;
    for (int i = 0; i < ((int)g[u].size()); i++) {
      int v = g[u][i].first, w = g[u][i].second;
      if (dis[s][v] > dis[s][u] + w) {
        dis[s][v] = dis[s][u] + w;
        Q.push(make_pair(dis[s][v], v));
      }
    }
  }
}
int tot;
bool check(int x) {
  T.init(n + tot + 2);
  int cur = 0;
  for (int i = 1; i <= n; i++) {
    if (st[i]) {
      T.addEdge(n + tot + 1, ++cur, st[i]);
      for (int j = 1; j <= n; j++)
        if (dis[i][j] <= x) {
          T.addEdge(cur, j + tot, 1);
        }
    }
    T.addEdge(i + tot, n + tot + 2, 1);
  }
  return T.maxflow(n + tot + 1, n + tot + 2) >= lim;
}
int main() {
  scanf("%d%d%d%d", &n, &m, &k, &lim);
  for (int i = 0; i < k; i++) {
    int x;
    scanf("%d", &x);
    st[x]++;
  }
  for (int i = 1; i <= n; i++)
    if (st[i]) tot++;
  while (m--) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    g[u].push_back(make_pair(v, w));
    g[v].push_back(make_pair(u, w));
  }
  for (int i = 1; i <= n; i++) dij(i);
  int l = 0, r = 1731312;
  while (l + 1 < r) {
    int mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  int ans = check(l) ? l : r;
  printf("%d\n", ans > 1731311 ? -1 : ans);
  return 0;
}
