#include <bits/stdc++.h>
using namespace std;
const int N = 900;
int v, e, n, k, dist[N][N], vis[N], vi = 0, start[N], match[N];
vector<pair<int, int> > g[N];
vector<vector<int> > adj;
void djikstra(int s) {
  vi++;
  priority_queue<pair<int, int> > q;
  q.push(make_pair(0, s));
  while (!q.empty()) {
    int node = q.top().second;
    int cost = q.top().first;
    q.pop();
    if (vis[node] == vi) continue;
    vis[node] = vi;
    dist[s][node] = -cost;
    dist[node][s] = -cost;
    for (int i = 0; i < g[node].size(); i++) {
      int newnode = g[node][i].first;
      if (vis[newnode] == vi) continue;
      q.push(make_pair(cost - g[node][i].second, newnode));
    }
  }
}
bool MaxMatching(int node) {
  if (vis[node] == vi) return 0;
  vis[node] = vi;
  for (int i = 0; i < adj[node].size(); i++) {
    int newnode = adj[node][i];
    if (match[newnode] == -1 || MaxMatching(match[newnode])) {
      match[newnode] = node;
      return 1;
    }
  }
  return 0;
}
bool check(int t) {
  adj.clear();
  adj.resize(v + 250);
  for (int i = 0; i < n; i++) {
    for (int j = 1; j <= v; j++) {
      if (dist[start[i]][j] <= t) {
        adj[i].push_back(j + 200);
        adj[j + 200].push_back(i);
      }
    }
  }
  memset(match, -1, sizeof(match));
  int cur = 0;
  for (int i = 0; i < n; i++) {
    vi++;
    cur += MaxMatching(i);
  }
  return (cur >= k);
}
int main() {
  scanf("%d%d%d%d", &v, &e, &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &start[i]);
    for (int j = 1; j <= v; j++) {
      dist[start[i]][j] = 1e9;
      dist[j][start[i]] = 1e9;
    }
  }
  for (int i = 0; i < e; i++) {
    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 = 0; i < n; i++) djikstra(start[i]);
  int low = 0, high = 1e8, res = -1;
  while (high >= low) {
    int mid = (low + high) / 2;
    if (check(mid))
      res = mid, high = mid - 1;
    else
      low = mid + 1;
  }
  printf("%d\n", res);
  return 0;
}
