#include <bits/stdc++.h>
using namespace std;
const int N = 605, M = 205;
int n, m, t, k;
int dist[N][N], city[N];
void floyd() {
  for (int i = 0; i < n; i++) dist[i][i] = 0;
  for (int k = 0; k < n; k++)
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++)
        if (dist[i][k] + dist[k][j] < dist[i][j])
          dist[i][j] = dist[i][k] + dist[k][j];
}
vector<int> adj[M];
int husband[N], vis[M], vid;
bool find_match(int node) {
  if (vis[node] == vid) return 0;
  vis[node] = vid;
  for (int child : adj[node]) {
    if (husband[child] == -1 || find_match(husband[child])) {
      husband[child] = node;
      return 1;
    }
  }
  return 0;
}
int max_match() {
  memset(husband, -1, sizeof husband);
  int cnt = 0;
  for (int i = 0; i < t; i++) {
    ++vid;
    cnt += find_match(i);
  }
  return cnt;
}
void init() {
  for (int i = 0; i < t; i++) adj[i].clear();
}
bool valid(int time) {
  init();
  for (int i = 0; i < t; i++)
    for (int j = 0; j < n; j++)
      if (dist[city[i]][j] <= time) adj[i].push_back(j);
  return max_match() >= k;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m >> t >> k;
  for (int i = 0; i < t; i++) {
    cin >> city[i];
    city[i]--;
  }
  memset(dist, '?', sizeof dist);
  while (m--) {
    int u, v, c;
    cin >> u >> v >> c;
    u--, v--;
    dist[u][v] = min(dist[u][v], c);
    dist[v][u] = min(dist[v][u], c);
  }
  floyd();
  int l = 0, r = 1731311, ans = -1;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (valid(mid)) {
      ans = mid;
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  cout << ans;
}
