#include <bits/stdc++.h>
using namespace std;
const int N = 610 * 2 + 100;
const int M = 205 * 6050;
const int inf = 1e9;
struct node {
  int v, len;
  friend bool operator<(const node& a, const node& b) {
    if (a.len != b.len) return a.len < b.len;
    return a.v < b.v;
  }
} p;
int v, e, n, k;
int st[620], num[620];
vector<node> g[620];
int inq[620];
set<node> s[620];
int dis[620];
void spfa(int x) {
  for (int i = 0; i <= v + 1; ++i) {
    inq[i] = 0;
    dis[i] = inf;
  }
  queue<int> que;
  inq[x] = 1;
  dis[x] = 0;
  que.push(x);
  while (!que.empty()) {
    int u = que.front();
    que.pop();
    int sz = g[u].size();
    inq[u] = 0;
    for (int i = 0; i <= sz - 1; ++i) {
      int v = g[u][i].v, len = g[u][i].len;
      if (dis[v] > dis[u] + len) {
        dis[v] = dis[u] + len;
        if (!inq[v]) {
          inq[v] = 1;
          que.push(v);
        }
      }
    }
  }
  for (int i = 1; i <= v; ++i) {
    p.v = i;
    p.len = dis[i];
    s[x].insert(p);
  }
}
int S, T, EN, d[N], head[N];
struct node1 {
  int v, w, nx;
} E[M << 1];
void init() {
  EN = 0;
  memset(head, -1, sizeof(head));
};
void add(int u, int v, int w) {
  E[EN].v = v;
  E[EN].w = w;
  E[EN].nx = head[u];
  head[u] = EN++;
  E[EN].v = u;
  E[EN].w = 0;
  E[EN].nx = head[v];
  head[v] = EN++;
}
inline long long MIN(long long x, long long y) { return x < y ? x : y; }
int dfs(int u, int x) {
  int t, r = 0;
  if (u == T) return x;
  for (int k = head[u]; k != -1 && x - r > 0; k = E[k].nx)
    if (E[k].w && d[E[k].v] == d[u] + 1 &&
        (t = dfs(E[k].v, min(x - r, E[k].w)))) {
      E[k].w -= t;
      E[k ^ 1].w += t;
      r += t;
    }
  if (!r) d[u] = -1;
  return r;
}
int q[M << 1];
int dinic() {
  int t, ans = 0, i, j, u;
  while (1) {
    memset(d, -1, sizeof(d));
    for (d[q[i = 0] = S] = 0, j = 1; i != j;)
      for (int k = head[u = q[i++]]; k != -1; k = E[k].nx)
        if (d[E[k].v] == -1 && E[k].w) {
          d[E[k].v] = d[u] + 1;
          if (E[k].v != T) q[j++] = E[k].v;
        }
    if (d[T] == -1) break;
    while (t = dfs(S, inf)) ans += t;
  }
  return ans;
}
set<node>::iterator it, ed;
void pr(int x) {
  for (it = s[x].begin(); it != s[x].end(); ++it) {
    printf("dis[%d] = %d \n", (*it).v, (*it).len);
  }
}
vector<int> ss;
bool ok(int t) {
  init();
  S = 0;
  T = v * 2 + 1;
  int sz = ss.size();
  for (int i = 0; i <= sz - 1; ++i) {
    int u = ss[i];
    add(S, u, num[u]);
    p.len = t;
    p.v = inf;
    ed = s[u].upper_bound(p);
    for (it = s[u].begin(); it != ed; ++it) {
      add(u, (*it).v + v, inf);
    }
  }
  for (int i = 1; i <= v; ++i) {
    add(i + v, T, 1);
  }
  int ans = dinic();
  return ans >= k;
}
int main() {
  scanf("%d%d%d", &v, &e, &n);
  scanf("%d", &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &st[i]);
    ++num[st[i]];
  }
  for (int i = 1; i <= v; ++i) {
    if (num[i]) ss.push_back(i);
  }
  for (int i = 1; i <= e; ++i) {
    int u, v, len;
    scanf("%d%d%d", &u, &v, &len);
    p.len = len;
    p.v = v;
    g[u].push_back(p);
    p.v = u;
    g[v].push_back(p);
  }
  int sz = ss.size();
  for (int i = 0; i <= sz - 1; ++i) {
    spfa(ss[i]);
  }
  int x = 0, y = 1739999;
  while (x <= y) {
    int m = (x + y) / 2;
    if (ok(m))
      y = m - 1;
    else
      x = m + 1;
  }
  if (x <= 1731311)
    printf("%d\n", x);
  else
    puts("-1");
  return 0;
}
