#include <bits/stdc++.h>
using i64 = long long;
using uchar = unsigned char;
constexpr int MaxV(600);
constexpr int MaxE(20000);
constexpr int maxn(200);
constexpr int Maxm(130000);
constexpr int Maxans(1731311);
template <class x_tp, class y_tp>
inline x_tp Min(const x_tp& x, const y_tp& y) {
  return x < y ? x : y;
}
template <class _Tp>
inline bool chkMin(_Tp& x, const _Tp& y) {
  return (x > y) && (x = y);
}
namespace IOManager {
constexpr int FILESZ(131072);
char buf[FILESZ];
const char *ibuf = buf, *tbuf = buf;
struct IOManager {
  inline char gc() {
    return (ibuf == tbuf) &&
                   (tbuf = (ibuf = buf) + fread(buf, 1, FILESZ, stdin),
                    ibuf == tbuf)
               ? EOF
               : *ibuf++;
  }
  template <class _Tp>
  inline operator _Tp() {
    _Tp s = 0u;
    char c = gc();
    for (; c < 48; c = gc())
      ;
    for (; c > 47; c = gc()) s = (_Tp)(s * 10u + c - 48u);
    return s;
  }
};
}  // namespace IOManager
IOManager::IOManager io;
template <int vsz, int esz>
struct NetWork {
  static constexpr int inf = 2147483647;
  struct Edge {
    int v, c;
    Edge *las, *rev;
    inline Edge* init(const int to, const int cap, Edge* const& ls,
                      Edge* const& re) {
      return v = to, c = cap, las = ls, rev = re, this;
    }
  } * las[vsz + 1], *cur[vsz + 1];
  Edge pool[esz << 1], *alc;
  inline void lnk(const int u, const int v, const int c) {
    las[u] = alc->init(v, c, las[u], alc + 1);
    ++alc;
    las[v] = alc->init(u, 0, las[v], alc - 1);
    ++alc;
  }
  int n, src, ter;
  int dis[vsz + 1], gap[vsz + 1];
  inline void clr(const int nn, const int s, const int t) {
    alc = pool;
    n = nn;
    src = s;
    ter = t;
    memset(las, 0, sizeof las);
  }
  int calc(const int now, const int maxflow) {
    if (now == ter) return maxflow;
    int s = 0;
    for (Edge*& o = cur[now]; o; o = o->las)
      if (o->c && dis[now] == dis[o->v] + 1) {
        int t = calc(o->v, Min(maxflow - s, o->c));
        o->c -= t;
        o->rev->c += t;
        if ((s += t) == maxflow) return s;
      }
    if (!--gap[dis[now]]) dis[src] = n;
    return ++gap[++dis[now]], cur[now] = las[now], s;
  }
  inline int flow() {
    memset(gap + 1, 0, n << 2);
    memset(dis + 1, 0, n << 2);
    std::copy(las + 1, las + n + 1, cur + 1);
    int ans = 0;
    for (gap[0] = n; dis[src] < n;) ans += calc(src, inf);
    return ans;
  }
};
struct Edge {
  int v, w;
  Edge* las;
  inline Edge* init(const int to, const int val, Edge* const& ls) {
    return v = to, w = val, las = ls, this;
  }
} * las[MaxV + 1];
inline void lnk() {
  static Edge pool[MaxE << 1], *alc = pool - 1;
  const int u = io, v = io, w = io;
  las[u] = (++alc)->init(v, w, las[u]);
  las[v] = (++alc)->init(u, w, las[v]);
}
struct Node {
  int idx, dis;
  Node() : idx(0), dis(0) {}
  Node(const int iidx, const int ddis) : idx(iidx), dis(ddis) {}
  inline bool operator<(const Node& rhs) const { return dis > rhs.dis; }
};
int dis[MaxV + 1];
std::priority_queue<Node> q;
inline void dijkstra(const int src) {
  for (q.push(Node(src, dis[src] = 0)); !q.empty();) {
    const int now = q.top().idx;
    q.pop();
    for (Edge* o = las[now]; o; o = o->las)
      if (chkMin(dis[o->v], dis[now] + o->w)) q.push(Node(o->v, dis[o->v]));
    for (; !q.empty() && dis[q.top().idx] != q.top().dis; q.pop())
      ;
  }
}
struct Edgelis {
  int u, v, w;
  Edgelis() : u(0), v(0), w(0) {}
  inline void init(const int s, const int t, const int d) {
    u = s;
    v = t;
    w = d;
  }
  inline bool operator<(const Edgelis& rhs) const { return w < rhs.w; }
} lis[MaxV * maxn + 1];
uchar issrc[MaxV + 1];
NetWork<(MaxV + 1) << 1, Maxm> net;
int main() {
  const int V = io;
  int E = io;
  const int N = io, K = io;
  for (int i = 1; i <= N; ++i) ++issrc[(int)io];
  for (; E; --E) lnk();
  const int src = V + V + 1, ter = src + 1;
  net.clr(ter, src, ter);
  Edgelis* st = lis;
  for (int s = 1; s <= V; ++s)
    if (net.lnk(s + V, ter, 1), issrc[s]) {
      memset(dis + 1, 0x7f, V << 2);
      dijkstra(s);
      for (int t = 1; t <= V; ++t)
        if (dis[t] <= Maxans) (++st)->init(s, t, dis[t]);
      net.lnk(src, s, issrc[s]);
    }
  std::sort(lis + 1, st + 1);
  Edgelis* const lr = st + 1;
  int cnt = 0;
  for (st = lis + 1; st < lr;) {
    const int curt = st->w;
    for (; st < lr && st->w <= curt; ++st) net.lnk(st->u, st->v + V, 1);
    if (K <= (cnt += net.flow())) return printf("%d", curt), 0;
  }
  return puts("-1"), 0;
}
