#include <bits/stdc++.h>
const long base = 151;
const long long MM = 1ll * 1000000007 * 1000000007;
using namespace std;
int BIT(int i, long long x) { return (x & (1 << i)); }
long long ONBIT(int i, long long x) { return (x | (1 << i)); }
long long OFFBIT(int i, long long x) { return (x & ~(1 << i)); }
long long FLIPBIT(int i, long long x) { return (x ^ (1 << i)); }
long long NUMBIT(long long x) { return __builtin_popcount(x); }
template <class T>
T GCD(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T LCM(T a, T b) {
  return a / GCD(a, b) * b;
}
long V, E, n, k;
long vt[200005];
vector<long> a[200005];
long long w[1001][1001];
pair<pair<long, long>, long> save[200005];
void read() {
  cin >> V >> E >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> vt[i];
  }
  for (int i = 1; i <= V; i++) {
    for (int j = 1; j <= V; j++) w[i][j] = 1000000007;
  }
  for (int i = 1; i <= V; i++) {
    w[i][i] = 0;
  }
  for (int i = 1; i <= E; i++) {
    long u, v;
    long long ts;
    cin >> u >> v >> ts;
    w[u][v] = w[v][u] = min(ts, w[u][v]);
  }
}
int mx[605], my[605], trc[605];
long timt() {
  memset(trc, 0, sizeof(trc));
  queue<int> q;
  for (long i = 1; i <= n; ++i) {
    if (mx[i] == 0) q.push(i);
  }
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (auto v : a[u]) {
      if (trc[v] == 0 && mx[u] != v) {
        trc[v] = u;
        if (my[v] == 0)
          return v;
        else
          q.push(my[v]);
      }
    }
  }
  return 0;
}
void morong(long res) {
  int x, tg;
  while (true) {
    x = trc[res];
    tg = mx[x];
    mx[x] = res;
    my[res] = x;
    res = tg;
    if (res == 0) return;
  }
}
long dp[605][605];
vector<pair<long, long> > kq;
bool check(long mid) {
  kq.clear();
  memset(mx, 0, sizeof(mx));
  memset(my, 0, sizeof(my));
  memset(trc, 0, sizeof(trc));
  for (long i = 1; i <= n; i++) a[i].clear();
  long cnt = 0;
  for (long i = 1; i <= n; i++) {
    for (long j = 1; j <= V; j++) {
      long ts = w[vt[i]][j];
      if (ts <= mid) {
        a[i].push_back(j);
      }
    }
  }
  while (true) {
    int res = timt();
    if (res == 0) break;
    morong(res);
  }
  int dem = 0;
  for (long i = 1; i <= n; ++i) {
    if (mx[i] != 0) kq.push_back(make_pair(i, mx[i])), dem++;
  }
  if (kq.size() >= k)
    return true;
  else
    return false;
}
void solve() {
  for (int k = 1; k <= V; k++) {
    for (int i = 1; i <= V; i++) {
      for (int j = 1; j <= V; j++) {
        w[i][j] = min(w[i][j], w[i][k] + w[k][j]);
      }
    }
  }
  long l = -1, r = 1000000007;
  while (r - l > 1) {
    long mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  if (r == 1000000007) {
    cout << -1;
    return;
  }
  cout << r;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  read();
  solve();
}
