#include <bits/stdc++.h>
using namespace std;
int pos[205], mark[605];
int dist[605][605];
int v, e, n, k;
struct edge {
  int to, next, w;
  edge() {}
  edge(int to, int next, int w) {
    this->to = to;
    this->next = next;
    this->w = w;
  }
} ed[20005 * 2];
int head[605], lnum;
vector<int> vt[605];
void addline(int a, int b, int w) {
  ed[lnum] = edge(b, head[a], w);
  head[a] = lnum++;
}
void spfa(int u) {
  queue<int> que;
  int mark[605];
  memset(mark, 0, sizeof(mark));
  dist[u][u] = 0;
  mark[u] = 1;
  que.push(u);
  while (!que.empty()) {
    int k = que.front();
    que.pop();
    mark[k] = 0;
    for (int i = head[k]; ~i; i = ed[i].next) {
      int to = ed[i].to;
      if (dist[u][to] > dist[u][k] + ed[i].w) {
        dist[u][to] = dist[u][k] + ed[i].w;
        if (mark[to] == 0) {
          mark[to] = 1;
          que.push(to);
        }
      }
    }
  }
}
bool g[205][605];
bool visit[605];
int match[605];
bool dfs(int u) {
  for (int i = 1; i <= v; ++i) {
    if (g[u][i] && !visit[i]) {
      visit[i] = true;
      if (match[i] == -1 || dfs(match[i])) {
        match[i] = u;
        return true;
      }
    }
  }
  return false;
}
int hungary() {
  int ans = 0;
  memset(match, -1, sizeof(match));
  for (int i = 1; i <= n; i++) {
    memset(visit, false, sizeof(visit));
    if (dfs(i)) ans++;
  }
  return ans;
}
bool judge(int t) {
  memset(g, false, sizeof(g));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= v; j++)
      if (dist[pos[i]][j] <= t) g[i][j] = true;
  int sum = hungary();
  return sum >= k;
}
int main() {
  memset(head, -1, sizeof(head));
  lnum = 0;
  for (int i = 0; i < 605; i++)
    for (int j = 0; j < 605; j++) dist[i][j] = 700000000;
  scanf("%d%d%d%d", &v, &e, &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &pos[i]);
  for (int i = 0; i < e; i++) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    addline(u, v, w);
    addline(v, u, w);
  }
  for (int i = 1; i <= n; i++)
    if (mark[pos[i]] == 0) {
      mark[pos[i]] = 1;
      spfa(pos[i]);
    }
  int l = 0, r = 1731311;
  while (l <= r) {
    int mid = l + r >> 1;
    if (judge(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  if (l > 1731311)
    printf("-1\n");
  else
    printf("%d\n", l);
}
